Packageorg.granite.reflect
Classpublic class DynamicProperty
InheritanceDynamicProperty Inheritance DescribedElement
ImplementsIMember, IVisitableElement

Represents a dynamic propert of a given Type instance.

Note: dynamic properties are never returned as part of Type's members. They belong, by definition, to instances, not classes, and their purpose is to represent a special kind of property when visiting a dynamic object or key/value pair class instances (such as Dictionary and the various collection classes with numeric keys).

See also

org.granite.reflect.Visitable


Public Properties
 PropertyDefined by
 InheriteddeclaredBy : Type
The Type instance this described element belongs to.
DescribedElement
  holder : Object
[read-only] The instance thet holds this dynamic property.
DynamicProperty
  key : *
[read-only] The key (name or object) of this dynamic property.
DynamicProperty
  propertyKey : String
[read-only] The String representation of this member (field or method qName, key of a dynamic property or dictionary, index of an array, etc.)
DynamicProperty
  type : Type
[read-only] The Type of the value of this dynamic property.
DynamicProperty
  value : *
The value of this dynamic property.
DynamicProperty
Public Methods
 MethodDefined by
  
DynamicProperty(holder:Object, key:Function, getter:Function = null, setter:* = null)
Constructs a new DynamicProperty instance.
DynamicProperty
 Inherited
equals(o:*):Boolean
Tells if this DescribedElement instance is equal to the supplied o parameter.
DescribedElement
  
isAccessor():Boolean
Checks if this member is an accessor (get/set) field.
DynamicProperty
  
isConstant():Boolean
Checks if this member is a constant field.
DynamicProperty
  
isConstructor():Boolean
Checks if this member is a constructor.
DynamicProperty
  
Checks if this member is a dynamic property (always false for Member, always true for DynamicProperty).
DynamicProperty
  
isMethod():Boolean
Checks if this member is a method.
DynamicProperty
  
isReadable():Boolean
Checks if this member is readable (fields only).
DynamicProperty
  
isStatic():Boolean
Checks if this member is static.
DynamicProperty
  
isVariable():Boolean
Checks if this member is a variable field.
DynamicProperty
  
isWriteable():Boolean
Checks if this member is writeable (fields only).
DynamicProperty
 Inherited
toString():String
Returns the a string (XML) representation of this described element.
DescribedElement
Property detail
holderproperty
holder:Object  [read-only]

The instance thet holds this dynamic property.

Implementation
    public function get holder():Object
keyproperty 
key:*  [read-only]

The key (name or object) of this dynamic property.

Implementation
    public function get key():*
propertyKeyproperty 
propertyKey:String  [read-only]

The String representation of this member (field or method qName, key of a dynamic property or dictionary, index of an array, etc.)

Implementation
    public function get propertyKey():String
typeproperty 
type:Type  [read-only]

The Type of the value of this dynamic property.

Implementation
    public function get type():Type
valueproperty 
value:*  [read-write]

The value of this dynamic property.

Implementation
    public function get value():*
    public function set value(value:*):void
Constructor detail
DynamicProperty()constructor
public function DynamicProperty(holder:Object, key:Function, getter:Function = null, setter:* = null)

Constructs a new DynamicProperty instance.

The optional getter and setter functions are expected to have the following signatures:

   function (holder:Object, key:*):*
   function (holder:Object, key:*, value:*):void

If no getter or setter functions are provided, it is expected that getting and setting this dynamic property value will follow this standard:

   holder[key]
   holder[key] = value

Parameters
holder:Object — the Type instance this dynamic property belongs to.
 
key:Function — the key (name or object) of this dynamic property.
 
getter:Function (default = null) — the getter function to be used to get this dynamic property value.
 
setter:* (default = null) — the setter function to be used to set this dynamic property value.
Method detail
isAccessor()method
public function isAccessor():Boolean

Checks if this member is an accessor (get/set) field.

Returns
Booleantrue if this member is an accessor, false otherwise.
isConstant()method 
public function isConstant():Boolean

Checks if this member is a constant field.

Returns
Booleantrue if this member is a constant, false otherwise.
isConstructor()method 
public function isConstructor():Boolean

Checks if this member is a constructor.

Returns
Booleantrue if this member is a constructor, false otherwise.
isDynamicProperty()method 
public function isDynamicProperty():Boolean

Checks if this member is a dynamic property (always false for Member, always true for DynamicProperty).

Returns
Booleantrue if this member is a dynamic property, false otherwise.
isMethod()method 
public function isMethod():Boolean

Checks if this member is a method.

Returns
Booleantrue if this member is a method, false otherwise.
isReadable()method 
public function isReadable():Boolean

Checks if this member is readable (fields only).

Returns
Booleantrue if this member is readable, false otherwise.
isStatic()method 
public function isStatic():Boolean

Checks if this member is static.

Returns
Booleantrue if this member is static, false otherwise.
isVariable()method 
public function isVariable():Boolean

Checks if this member is a variable field.

Returns
Booleantrue if this member is a variable, false otherwise.
isWriteable()method 
public function isWriteable():Boolean

Checks if this member is writeable (fields only).

Returns
Booleantrue if this member is writeable, false otherwise.