Packageorg.granite.reflect
Interfacepublic interface IAnnotatedElement
ImplementorsMember, Type

This interface is implemented by all reflection API classes that describe an element supporting metadata annotations.

Possible annotated elements in ActionScript 3 are classes/interfaces, constansts, variables accessors (get/set) and methods. Annotations on constructors are not supported.



Public Properties
 PropertyDefined by
  annotations : Array
[read-only] An array that contains all annotations directly attached to this IAnnotatedElement.
IAnnotatedElement
Public Methods
 MethodDefined by
  
getAnnotation(type:String, recursive:Boolean = false):Annotation
Returns the first Annotation whose name is equal to the supplied type parameter, attached to this IAnnotatedElement.
IAnnotatedElement
  
getAnnotations(recursive:Boolean = false, pattern:String = "^_?[^_]"):Array
Returns an array (possibly empty) that contains all annotations attached to this IAnnotatedElement.
IAnnotatedElement
  
isAnnotationPresent(type:String, recursive:Boolean = false):Boolean
Tests if an Annotation, whose name is equal to the supplied type parameter, is attached to this IAnnotatedElement.
IAnnotatedElement
Property detail
annotationsproperty
annotations:Array  [read-only]

An array that contains all annotations directly attached to this IAnnotatedElement.

Implementation
    public function get annotations():Array

See also

Method detail
getAnnotation()method
public function getAnnotation(type:String, recursive:Boolean = false):Annotation

Returns the first Annotation whose name is equal to the supplied type parameter, attached to this IAnnotatedElement.

Parameters
type:String — the name of the annotation to look for.
 
recursive:Boolean (default = false) — should we look for annotations attached to overridden elements (non-static accessors or methods) or superclasses/superinterfaces ?

Returns
Annotation — an Annotation instance or null if it cannot be found.

See also

getAnnotations()method 
public function getAnnotations(recursive:Boolean = false, pattern:String = "^_?[^_]"):Array

Returns an array (possibly empty) that contains all annotations attached to this IAnnotatedElement.

Parameters
recursive:Boolean (default = false) — should we look for annotations attached to overridden elements (non-static accessors or methods) or superclasses/superinterfaces ?
 
pattern:String (default = "^_?[^_]") — a regexp expression used as a filter. Default is to eliminate all annotations prefixed with a double '_' character. You may use this parameter to find all annotations with a specific name.

Returns
Array — an array that contains all annotations attached to this IAnnotatedElement.

See also

isAnnotationPresent()method 
public function isAnnotationPresent(type:String, recursive:Boolean = false):Boolean

Tests if an Annotation, whose name is equal to the supplied type parameter, is attached to this IAnnotatedElement.

Parameters
type:String — the name of the annotation to look for.
 
recursive:Boolean (default = false) — should we look for annotations attached to overridden elements (non-static accessors or methods) or superclasses/superinterfaces ?

Returns
Booleantrue if the annotation can be found, false otherwise.

See also