MultiAccessor

Kind of class:public class
Package:com.bourre.core
Inherits from:none
Implements:
Author:Cédric Néhémie
Classpath:com.bourre.core.MultiAccessor
File last modified:Monday, 24 November 2008, 11:36:49
The MultiAccessor provides read and write access
to the specified methods and properties of a single object.

Summary


Constructor
  • MultiAccessor (t:Object, setters:Array, getters:Array = null)
    • Creates a new MethodAccessor instance which
Instance methods

Constructor

MultiAccessor

public function MultiAccessor (
t:Object, setters:Array, getters:Array = null)

Creates a new MethodAccessor instance which
allow access to the specified getter and

setter methods of the passed-in object.
Parameters:
o :
object onto which access methods
setters:
names of the setter methods or properties on the object
getters:
names of the getter methods on the object, use only
for function members
Throws:
  • {VISDOC_LINK_0}NullPointerException — Can't create an accessors
    on a null object
  • {VISDOC_LINK_1}NoSuchMethodException — There is no setter method
    of the specified name
  • {VISDOC_LINK_2}NoSuchMethodException — There is no getter method
    of the specified name

Instance methods

getGetterHelper

public function getGetterHelper (
) : Array

Returns:
  • the string name of all getters access used
    by this accessor
    #

getSetterHelper

public function getSetterHelper (
) : Array

Returns:
  • the string name of all setters access used
    by this accessor
    #

getTarget

public function getTarget (
) : Object

Returns:
  • the object onto which this accessor operate
    #

getValue

public function getValue (
) : Array

Returns an array of all values returned by the specified
properties and methods of the object.
Returns:
  • current values returned by the target getter methods
Throws:
  • {VISDOC_LINK_0}ClassCastException — A getter method
    doesn't return a number.

setValue

public function setValue (
values:Array) : void

Sets the new values for the properties and methods handled
by the specified setter methods and properties defined
during the creation of this instance.
Parameters:
value:
the new values for the target setter methods
and properties
Throws:
  • {VISDOC_LINK_0}ClassCastException — A target setter
    methods doesn't accept number as argument.

toString

public function toString (
) : String

Returns the string representation of this object.
Returns:
  • the string representation of this object