Legato.Beans.Property

Models a property with type, setter and getter.

Summary
Legato.Beans.PropertyModels a property with type, setter and getter.
Properties
type{<Legato.Lang.AnyType>} Type of the property.
setter{Function} Setter function for the property.
getter{Function} Getter function for the property.
Functions
initializeConstructs a new property.
setSets value to the given object instance.
getGets value from the given object instance.

Properties

type

{<Legato.Lang.AnyType>} Type of the property.

setter

{Function} Setter function for the property.

getter

{Function} Getter function for the property.

Functions

initialize

initialize : function(type,
setter,
getter)

Constructs a new property.

Parameters

type{<Legato.Lang.AnyType>} type of the property.
setter{Function} setter function.
getter{Function} getter function.

set

set : function(instance,
value)

Sets value to the given object instance.  Throws {Legato.Lang.Exception} for read-only property.

Parameters

instanceinstance to set value to.
valuevalue to be set.

get

get : function(instance)

Gets value from the given object instance.  Throws {Legato.Lang.Exception} for write-only property.

Returns

Value of the instance property returned by the getter function.

Parameters

instanceinstance to set value to.
initialize : function(type,
setter,
getter)
Constructs a new property.
set : function(instance,
value)
Sets value to the given object instance.
get : function(instance)
Gets value from the given object instance.