Packagecom.bourre.core
Classpublic class AccessorFactory

Player version: Flash Player 9.0
Language version: ActionScript 3.0

A factory for Accessor and AccessorComposer creation. With the AccessorFactory, you don't have to know if you attempt to access to a property or to a method. The creational methods of the factory will return the corresponding concret accessor.

See also

Accessor.html
AccessorComposer.html


Public Methods
 MethodDefined by
  
getAccessor(t:Object, setter:String, getter:String = null):Accessor
[static] Returns an accessor object for the passed-in property or methods of the specified target object.
AccessorFactory
  
getMultiAccessor(t:Object, setter:Array, getter:Array = null):AccessorComposer
[static] Returns an accessor object for the passed-in properties or methods of the specified target object.
AccessorFactory
Method detail
getAccessor()method
public static function getAccessor(t:Object, setter:String, getter:String = null):Accessor

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns an accessor object for the passed-in property or methods of the specified target object. The concret type of the accessor cannot be known before the call, as for any other factories.

In the case of accessing to method member, the setter and getter arguments must be set.

Parameters
t:Object — the object onto which access member(s)
 
setter:String — name of the setter property on the target
 
getter:String (default = null) — name of the getter property on the target, used only if the setter property is a function

Returns
Accessor — a concret Accessor to the specified member(s)

Throws
NullPointerException — The passed-in target is null
 
NoSuchFieldException — The target object doesn't own any field named as setter
 
NoSuchMethodException — There'is no getter method to associate with the corresponding setter
getMultiAccessor()method 
public static function getMultiAccessor(t:Object, setter:Array, getter:Array = null):AccessorComposer

Player version: Flash Player 9.0
Language version: ActionScript 3.0

Returns an accessor object for the passed-in properties or methods of the specified target object. The concret type of the accessor cannot be known before the call, as for any other factories.

In the case of accessing to method member, the setter and getter arguments must be set.

Parameters
t:Object — the object onto which access member(s)
 
setter:Array — array of setter member's name
 
getter:Array (default = null) — array of getter member's name, when mixing properties and methods, the same order must be conservated in the two arrays

Returns
AccessorComposer — a concret AccessorComposer to the specified member(s)

Throws
NullPointerException — The passed-in target is null
 
NoSuchFieldException — The target object doesn't own any field named as setter
 
NoSuchMethodException — There'is no getter method to associate with the corresponding setter

Example
The orders of the parameters must be equivalent both in the setter array and in the getter array. When mixing properties and methods, the getter name of a properties is null, as the properties may generally provides read and write access to it.
AccessorFactory.getMultiAccessor ( 
      anObject,
      [ "someProperty", "getSomething", "getAnotherThing" ],
      [ null,     "setSomething", "setAnotherThing" ]
   );