Objective-C API Library Reference  4.3.0-42-g45f162a
 All Classes Functions Typedefs Properties Pages
Public Functions | List of all members
PWXmlStateLock Class Reference

The PWXmlStateLock class provides methods to interact with the PureWeb application state, once you have acquired a state lock (see the acquireLock method in PWXmlStateManager). The lock is thread-safe.

When referring to a value in the application state tree, provide the entire path (except for the root element, which should be omitted), dividing each level using a slash, for example: /MainPage/TabX/ControlName. The path can also contain conditional operators:

Constructors

(id) - init:state:
 

Public Functions

(id) - getTextAs:childPath:
 
(id) - getTextAsWithChildPathAndDefault:defaultValue:
 
(PWXmlElement *) - getTree:
 
(PWXmlElement *) - getTree:allowCreate:
 
(NSString *) - getValue:
 
(void) - releaseLock
 
(void) - setTree:tree:
 
(void) - setValue:value:
 

Methods Descriptions

- (id) getTextAs: (const char *)  objCType
childPath: (NSString *)  childPath 

Returns the value of the element at the specified path in the application state tree. The value will be returned in the specified data type.

- (id) getTextAsWithChildPathAndDefault: (NSString *)  childPath
defaultValue: (id)  defaultValue 

Returns the value of the element at the specified path in the application state tree. The value will be returned in the specified data type. Will return the specified default if the value does not exist, or cannot be converted.

- (PWXmlElement *) getTree: (NSString *)  path

Returns the underlying XML node at the specified path. The node returned is a copy of the application state at that path, including the children elements, if any. Use setTree to update the application state if making modifications to that node.

Note
This element may not be valid after the lock is released.
- (PWXmlElement *) getTree: (NSString *)  path
allowCreate: (BOOL)  allowCreate 

Copies the application state tree at the specified path. If allowCreate is set to false, then null will be returned if the path does not exist.

- (NSString *) getValue: (NSString *)  path

Returns the value of the element at the specified path in the application state tree, or null if it does not exist.

- (id) init: (PWXmlStateManager *)  stateManager
state: (PWXmlState *)  state 

Initializes a new instance of PWXmlStateLock with PWXmlStateManager.

- (void) releaseLock

Releases the application state lock.

- (void) setTree: (NSString *)  path
tree: (PWXmlElement *)  tree 

Replaces the application state tree at the specified path with the element provided.

- (void) setValue: (NSString *)  path
value: (NSString *)  value 

Sets the value of the element at the specified path in the application state tree.