Class ReflectionField

Class that represents a reflectable script field.

Hierarchy (view full)

Constructors

Properties

declaringType: Type

The class that declares this member.

name: string

The name of given type.

Methods

  • 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

  • Sets value of this field to given value.

    Parameters

    • instance: any

      The object whose value will be get.

    Returns any

    Current field value.

  • Checks whether the member has the given attribute type.

    Parameters

    Returns boolean

    True if the attribute exists on the member.

  • Checks if this field is static.

    Returns boolean

    Whether this method is static.

  • Sets value of this field to given value.

    Parameters

    • instance: any

      The object whose value will be set.

    • value: any

      The new field value.

    Returns void