Zapatec.SRProp

Overview | File | Class | Tree | Index | Help

Zapatec Utils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## Class Zapatec.SRProp

    Object
       |
       +--Zapatec.SRProp

class Zapatec.SRProp

Defined in zpobjects.js

Constructor Summary
`Zapatec.SRProp(obj)` object for saving and restoring properties of the given object - SRProp (Save Restore Object Properties)

Method Summary
`Object` | `destroy()` Destroys an object.
`object` | `getObject()` Returns the object we are working with.
`Object` | `getProp(propName)` Gets property value by name from the savedProp array You should not overwrite this method as it is core of the object.
`object` | `getSavedProps()` Returns the hash of the saved properties.
`boolean` | `isEmpty()` Checks if hash of saved properties is empty.
`void` | `restoreAll()` Restores all properties from the savedProp array You should not overwrite this method as it is core of the object.
`Object` | `restoreProp(propName)` Restores the named property from savedProp array.
`Object` | `restoreProps(propName)` Restores the named properties from savedProp array You should not overwrite this method as it is core of the object.
`Object` | `saveProp(propName)` Saves the named property to savedProp array You should not overwrite this method as it is core of the object.
`Object` | `saveProps()` Saves the named properties to savedProp array You should not overwrite this method as it is core of the object.

Constructor Detail

### Zapatec.SRProp

    Zapatec.SRProp(obj)

object for saving and restoring properties of the given object - SRProp (Save Restore Object Properties)

Parameters:

`obj` - [object] - object to work with this class adds methods to any given object which enable to save and restore properties using following \code var object = {}; ob = new Zapatec.SRProp(obj); object.prop = ""; ob.saveProp("prop"); object.prop = "ttt"; ob.restoreProp("prop"); ob.restoreAll(); \endcode

Method Detail

### destroy

    Object destroy()

Destroys an object.

### getObject

    object getObject()

Returns the object we are working with.

Returns:

object ot work with.

### getProp

    Object getProp(propName)

Gets property value by name from the savedProp array You should not overwrite this method as it is core of the object.

Parameters:

`propName` - [string] - name of the property to get - can be the followin "prop", "level1.level2" and so on.

### getSavedProps

    object getSavedProps()

Returns the hash of the saved properties. This method can be easily overwritten for extending object.

Returns:

object containing all saved properties.

### isEmpty

    boolean isEmpty()

Checks if hash of saved properties is empty.

Returns:

true if there are no saved properties, otherwise false.

### restoreAll

    void restoreAll()

Restores all properties from the savedProp array You should not overwrite this method as it is core of the object.

### restoreProp

    Object restoreProp(propName)

Restores the named property from savedProp array. You should not overwrite this method as it is core of the object.

Parameters:

`propName` - [string] - name of the property to restore - can be the followin "prop", "level1.level2" and so on.

Returns:

true if successful, otherwise false

### restoreProps

    Object restoreProps(propName)

Restores the named properties from savedProp array You should not overwrite this method as it is core of the object.

Parameters:

`can` - be any set of params, but only strings will be parsed.

Returns:

true if successful, otherwise false

### saveProp

    Object saveProp(propName)

Saves the named property to savedProp array You should not overwrite this method as it is core of the object.

Parameters:

`propName` - [string] - name of the property to save - can be the followin "prop", "level1.level2" and so on.

Returns:

true if successful, otherwise false

### saveProps

    Object saveProps()

Saves the named properties to savedProp array You should not overwrite this method as it is core of the object.

Parameters:

`can` - be any set of params, but only strings will be parsed.

Returns:

an array of saved properties names

Overview | File | Class | Tree | Index | Help

Zapatec Utils

PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Documentation generated by JSDoc on Thu Aug 16 12:18:39 2007