# Legato.Util.Accessor

Small helper class which implements some sort of an setter, getter Pattern. With this class you’re able to wrap some other classes so that the wrapped classed is accessed just with the getter setter Pattern.

Summary

Legato.Util.Accessor | Small helper class which implements some sort of an setter, getter Pattern.
Properties |
target | {Object} The wrapped target class
field | If defined the field will be used if existing in target
setter | If defined this function will be used as setter if existing in target
getter | If defined this function will be used as getter if existing in target
Functions |
initialize | Basic ctor for the accessor class
setValue | Setter for wraped target instance value
getValue | Getter for wraped target instance value

### Properties

### target

{Object} The wrapped target class

### field

If defined the field will be used if existing in target

### setter

If defined this function will be used as setter if existing in target

### getter

If defined this function will be used as getter if existing in target

### Functions

### initialize

> initialize : function( | options | )

Basic ctor for the accessor class

#### Parameters

options | {Object} A Hashmap containing option parameters for this class The following keys are supported

- target {Object} the used target instance
- field {String} Optional field specification. Will be used as getter and setter if defined
- setter {String} Optional function specification which must exists in target
- getter {String} Optional function specification which must exists in target

### setValue

> setValue : function( | value | )

Setter for wraped target instance value

#### Parameters

value | {Object} The value to set. Could be any type

### getValue

> getValue : function()

Getter for wraped target instance value

#### Returns

{Object} Could be any type

> initialize : function( | options | )

Basic ctor for the accessor class

> setValue : function( | value | )

Setter for wraped target instance value

> getValue : function()

Getter for wraped target instance value