Packageflare.util
Classpublic class Property
ImplementsIEvaluable, IPredicate

Utility class for accessing arbitrary property chains, allowing nested property expressions (e.g., x.a.b.c or x.a[1]). To reduce initialization times, this class also maintains a static cache of all Property instances created using the static $() method.



Public Properties
 PropertyDefined by
  name : String
[read-only] The property name string.
Property
  proxy : IValueProxy
[static][read-only] A minimal IValueProxy instance that gets and sets property values through Property instances.
Property
Public Methods
 MethodDefined by
  
Property(name:String)
Creates a new Property, in most cases the static $ method should be used instead of this constructor.
Property
  
$(name:String):Property
[static] Requests a Property instance for the given property name.
Property
  
clearCache():void
[static] Clears the cache of created Property instances
Property
  
deleteValue(x:Object):void
Deletes a dynamically-bound property from an object.
Property
  
eval(x:Object = null):*
Gets the value of this property for the input object; this is the same as getValue, but provided in order to implement the IEvaluable interface.
Property
  
getValue(x:Object):*
Gets the value of this property for the input object.
Property
  
predicate(x:Object):Boolean
Gets the value of this property and casts the result to a Boolean value.
Property
  
setValue(x:Object, val:*):void
Sets the value of this property for the input object.
Property
Property detail
nameproperty
name:String  [read-only]

The property name string.

Implementation
    public function get name():String
proxyproperty 
proxy:IValueProxy  [read-only]

A minimal IValueProxy instance that gets and sets property values through Property instances.

Implementation
    public static function get proxy():IValueProxy
Constructor detail
Property()constructor
public function Property(name:String)

Creates a new Property, in most cases the static $ method should be used instead of this constructor.

Parameters
name:String — the property name string
Method detail
$()method
public static function $(name:String):Property

Requests a Property instance for the given property name. This is a factory method that caches and reuses property instances, saving memory and construction time. This method is the preferred way of getting a property and should be used instead of the constructor.

Parameters
name:String — the name of the property

Returns
Property — the requested property instance
clearCache()method 
public static function clearCache():void

Clears the cache of created Property instances

deleteValue()method 
public function deleteValue(x:Object):void

Deletes a dynamically-bound property from an object.

Parameters
x:Object — the object from which to delete the property
eval()method 
public function eval(x:Object = null):*

Gets the value of this property for the input object; this is the same as getValue, but provided in order to implement the IEvaluable interface.

Parameters
x:Object (default = null) — the object to retrieve the property value for

Returns
* — the property value
getValue()method 
public function getValue(x:Object):*

Gets the value of this property for the input object.

Parameters
x:Object — the object to retrieve the property value for

Returns
* — the property value
predicate()method 
public function predicate(x:Object):Boolean

Gets the value of this property and casts the result to a Boolean value.

Parameters
x:Object — the object to retrieve the property value for

Returns
Boolean — the property value as a Boolean
setValue()method 
public function setValue(x:Object, val:*):void

Sets the value of this property for the input object. If the reset flag is true, all properties along a property chain will be updated. Otherwise, only the last property in the chain is updated.

Parameters
x:Object — the object to set the property value for
 
val:* — the value to set