MethodAccessor

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

Summary


Constructor
  • MethodAccessor (o:Object, setter:String, getter:String)
    • Creates a new MethodAccessor instance which
Instance methods

Constructor

MethodAccessor

public function MethodAccessor (
o:Object, setter:String, getter:String)

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
setter:
name of the setter method on the object
getter:
name of the getter method on the object
Throws:
  • {VISDOC_LINK_0}NullPointerException — Can't create an accessor
    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 (
) : String

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

getSetterHelper

public function getSetterHelper (
) : String

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

getTarget

public function getTarget (
) : Object

Returns:
  • the object onto which this accessor operate
    #
Specified by:

getValue

public function getValue (
) : Number

Returns the numeric value returned by the getter method specified
during the creation of the object.
Returns:
  • current value returned by the target getter method
Throws:
  • {VISDOC_LINK_0}ClassCastException — The target getter
    method doesn't return a number.
Specified by:

setValue

public function setValue (
value:Number) : void

Sets the new value for the property handled by the
specified setter method defined during the creation
of this instance.
Parameters:
value:
the new value for the target setter method
Throws:
  • {VISDOC_LINK_0}ClassCastException — The target setter
    method doesn't accept number as argument.
Specified by:

toString

public function toString (
) : String

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