PropertyAccessor

Kind of class:class
Inherits from:none
Implements:
Version:1.0
Author:Francis Bourre
Classpath:com.bourre.core.PropertyAccessor
File last modified:Wednesday, 31 October 2007, 07:35:29
PropertyAccessor proxies property accesses (getter/setter) for an instance.

Use String access to define accessor process for a specific instance property.

Implements IAccessor interface.

Take a look at MethodAccessor to see another accessor implementation.

See AccessorFactory for accessor automatic build process.

Example

var o : IAccessor = new PropertyAccessor( this, "__prop" );
o.setValue( 100 );
var n : Number = o.getValue();

Constructor

PropertyAccessor

function PropertyAccessor (
p:String)
Constructs a new PropertyAccessor instance

p property name must be defined in t instance context.

Parameters:
t:
Object where f function is applied
p:
String property name

Instance methods

getGetterHelper

function getGetterHelper (
)
Returns property used by current getter to retrieve object value.
Returns:
String

getProperty

function getProperty (
) : String
Returns property name.
Returns:
String

getSetterHelper

function getSetterHelper (
)
Returns property used by current setter to modify object value.
Returns:
String

getTarget

function getTarget (
)
Returns object target.

Where accessor is applied

Returns:
object instance (relaxed type)
Specified by:

getValue

function getValue (
)
Returns current value targeted by the accessor.
Returns:
value
Specified by:

setValue

function setValue (
) : Void
Sets passed-in value to object using setter property name defined
during instanciation.
Parameters:
value:
value to set
Specified by:

toString

function toString (
) : String
Returns the string representation of this instance.
Returns:
the string representation of this instance