Packageorg.spicefactory.lib.reflect
Classpublic class MetadataAware
InheritanceMetadataAware Inheritance Object
Subclasses ClassInfo, Member

Base class for all types that can have associated metadata tags.



Public Methods
 MethodDefined By
  
getAllMetadata(validate:Boolean = true):Array
Returns all metadata tags for this type in no particular order.
MetadataAware
  
getMetadata(type:Object, validate:Boolean = true):Array
Returns all metadata tags for the specified type for this element.
MetadataAware
  
hasMetadata(type:Object):Boolean
Indicates whether this element has at least one metadata tag of the specified type.
MetadataAware
Method Detail
getAllMetadata()method
public function getAllMetadata(validate:Boolean = true):Array

Returns all metadata tags for this type in no particular order.

Parameters

validate:Boolean (default = true) — whether the returned objects should be validated (applies only for metadata mapped to custom classes)

Returns
Array — all metadata tags for this type
getMetadata()method 
public function getMetadata(type:Object, validate:Boolean = true):Array

Returns all metadata tags for the specified type for this element. If no tag for the specified type exists an empty Array will be returned.

In case you registered a custom metadata class for the specified name, an Array of instances of that class is returned. You must use a parameter of type Class specifying the mapped metadata class for the type parameter then.

Otherwise an Array of instances of the generic Metadata class is returned. In this case you use the name of the metadata tag as a String for the type parameter.

Parameters

type:Object — for mapped metadata the mapped class otherwise the name of the metadata tag as a String.
 
validate:Boolean (default = true) — whether the returned objects should be validated (applies only for metadata mapped to custom classes)

Returns
Array — all metadata tags for the specified type for this element
hasMetadata()method 
public function hasMetadata(type:Object):Boolean

Indicates whether this element has at least one metadata tag of the specified type.

In case you registered a custom metadata class for the specified name, you must use a parameter of type Class specifying the mapped metadata class. Otherwise you use the name of the metadata tag as a String for the type parameter.

Parameters

type:Object — for mapped metadata the mapped class otherwise the name of the metadata tag as a String.

Returns
Boolean — true if this element has at least one metadata tag of the specified type