Class ReflectionMethod

Class that represents a reflectable script method.

Hierarchy (view full)

Constructors

Properties

declaringType: Type

The class that declares this member.

name: string

The name of given type.

Accessors

  • get parameterCount(): number
  • Gets the number of arguments.

    Returns number

Methods

  • Checks if given method can be called with given arguments.

    Parameters

    • methodArguments: any[]

      Array of objects that would be passed as arguments to this method, if it was being invoked.

    Returns boolean

    Whether this method accepts given arguments.

  • Retrieves a custom attribute of a specified type that is applied to a specified member.

    Type Parameters

    Parameters

    • attributeType: ClassOf<T>

      The type of attribute to search for. Only attributes that are assignable to this type are returned.

    Returns T

    A custom attribute that matches T, or null if no such attribute is found.

  • Retrieves custom attributes of a specified type that is applied to this member.

    Type Parameters

    Parameters

    • attributeType: ClassOf<T>

      The type of attribute to search for. Only attributes that are assignable to this type are returned.

    Returns T[]

    Custom attributes that matche T

  • Checks whether the member has the given attribute type.

    Parameters

    Returns boolean

    True if the attribute exists on the member.

  • Invokes this method with given parameters and given instance object.

    Parameters

    • obj: any

      Instance of the object that will be used as 'this' reference.

    • Rest...parameters: any[]

      Array of objects that will be passed as arguments to the method call.

    Returns any

    Result of the method call.

  • Checks if this method is static.

    Returns boolean

    Whether this method is static.