Options
All
  • Public
  • Public/Protected
  • All
Menu

Class LabelAnnotation

An annotation for attaching a label to a programmatic element. Can be queried with LabelAnnotation.getForClass() for example.

Hierarchy

Implements

Index

Constructors

constructor

Properties

Readonly $metadataName

$metadataName: string

Readonly ngMetadataName

ngMetadataName: string = undefined

Readonly text

text: string

Methods

applyToClass

  • applyToClass(target: any): this

applyToConstructorParameter

  • applyToConstructorParameter(target: any, index: number): this

applyToMethod

  • applyToMethod(target: any, name: string): this

applyToParameter

  • applyToParameter(target: any, name: string, index: number): this

applyToProperty

  • applyToProperty(target: any, name: string): this

clone

  • clone(): this

toString

  • toString(): string

Static decorator

  • Construct a decorator suitable for attaching annotations of the called type onto classes, constructor parameters, methods, properties, and parameters. Must be called while referencing the subclass of Annotation you wish to construct the decorator for. E.g., for FooAnnotation, call FooAnnotation.decorator().

    Type parameters

    Parameters

    • this: AnnotationConstructor<T, TS>

      The Annotation subclass for which the decorator is being constructed

    • Optional options: AnnotationDecoratorOptions<T, TS>

      Allows for specifying options which will modify the behavior of the decorator. See the DecoratorOptions documentation for more information.

    Returns AnnotationDecorator<TS>

Static filter

Static getAllForClass

Static getAllForConstructorParameters

  • Get all instances of this annotation class attached to the parameters of the constructor for the given class. If called on a subclass of Annotation, it returns only annotations that match that subclass.

    Type parameters

    Parameters

    • this: AnnotationConstructor<T, TS>
    • type: any

      The class where constructor parameter annotations should be checked for

    Returns T[][]

Static getAllForMethod

  • Get all instances of this annotation class attached to the given method. If called on a subclass of Annotation, it returns only annotations that match that subclass.

    Type parameters

    Parameters

    • this: AnnotationConstructor<T, TS>
    • type: any

      The class where the method is defined

    • methodName: string

      The name of the method to check

    Returns T[]

Static getAllForParameters

  • Get all instances of this annotation class attached to the parameters of the given method. If called on a subclass of Annotation, it returns only annotations that match that subclass.

    Type parameters

    Parameters

    • this: AnnotationConstructor<T, TS>
    • type: any

      The class where the method is defined

    • methodName: string

      The name of the method where parameter annotations should be checked for

    Returns T[][]

Static getAllForProperty

  • Get all instances of this annotation class attached to the given property. If called on a subclass of Annotation, it returns only annotations that match that subclass.

    Type parameters

    Parameters

    • this: AnnotationConstructor<T, TS>
    • type: any

      The class where the property is defined

    • propertyName: string

      The name of the property to check

    Returns T[]

Static getForClass

Static getForMethod

  • Get one instance of this annotation class attached to the given method. If called on a subclass of Annotation, it returns only annotations that match that subclass.

    Type parameters

    Parameters

    • this: AnnotationConstructor<T, TS>
    • type: any

      The class where the method is defined

    • methodName: string

      The name of the method to check

    Returns T

Static getForProperty

  • Get one instance of this annotation class attached to the given property. If called on a subclass of Annotation, it returns only annotations that match that subclass.

    Type parameters

    Parameters

    • this: AnnotationConstructor<T, TS>
    • type: any

      The class where the property is defined

    • propertyName: string

      The name of the property to check

    Returns T

Static getMetadataName

  • getMetadataName(): string

Generated using TypeDoc