Kanzi Java API
DataContext Class Reference

DataContext acts as a container for data. More...

Inheritance diagram for DataContext:
[legend]
Collaboration diagram for DataContext:
[legend]

Classes

interface  ModifiedSubscriptionFunction
 Callback functions for Modified Subscription events. More...
 
class  ModifiedSubscriptionToken
 Token to represent a Modified Subscription. More...
 

Public Member Functions

ModifiedSubscriptionToken addModifiedNotificationHandler (ModifiedSubscriptionFunction modifiedHandlerFunction)
 Allows to subscribe to modifications in this data context. More...
 
DataObject getData ()
 Retrieves the root object of the underlying data tree. More...
 
DataContext lookupDataContext (String relativePath)
 Performs object look up by path. More...
 
void notifyModified ()
 Triggers modification procedure in this data context, which invokes the subscriptions.
 
void removeModifiedNotificationHandler (DataContext.ModifiedSubscriptionToken token)
 Removes a modification subscription. More...
 
- Public Member Functions inherited from Resource
String getName ()
 Gets the resource name. More...
 
String getUrl ()
 Gets the resource URL. More...
 
void setKeepAlive (boolean keepAlive)
 Sets the keep alive flag. More...
 
- Public Member Functions inherited from KanziObject
boolean equals (Object object)
 
Domain getDomain ()
 Returns the domain the object belongs to. More...
 
Metaclass getDynamicMetaclass ()
 Returns the metaclass of the dynamic type of the object. More...
 
boolean isStale ()
 Test if the object is stale i.e. More...
 
void releaseOwnership ()
 Release ownership of the backing native object from this object. More...
 
void removeLocalValue (PropertyType propertyType)
 Removes the local value associated with the property. More...
 
boolean takeOwnership ()
 Take ownership of the backing native object in this object. More...
 

Static Public Member Functions

static Metaclass getStaticMetaclass ()
 Returns the metaclass of this class. More...
 
- Static Public Member Functions inherited from KanziObject
static Metaclass getStaticMetaclass ()
 Returns the metaclass of this class. More...
 

Additional Inherited Members

- Public Attributes inherited from DataContext
AbstractMetaclass DataContextMetaclass = new AbstractMetaclass("Kanzi.DataContext")
 
DynamicPropertyType< ResourceDataContextProperty
 
DynamicPropertyType< ResourceItemsSourceProperty
 

Detailed Description

DataContext acts as a container for data.

All data within the data context is described as a tree of data objects. The class provides access and look-up functionality of the contained data objects.

Member Function Documentation

ModifiedSubscriptionToken addModifiedNotificationHandler ( ModifiedSubscriptionFunction  modifiedHandlerFunction)

Allows to subscribe to modifications in this data context.

Parameters
modifiedHandlerFunctionCallback that is invoked when a change occurs in this data context.
Returns
Token that can be used to identify and remove a given subscription.
DataObject getData ( )

Retrieves the root object of the underlying data tree.

Returns
The data object that is the root of the data tree.
static Metaclass getStaticMetaclass ( )
static

Returns the metaclass of this class.

Returns
Static instance of metaclass of this data context.
DataContext lookupDataContext ( String  relativePath)

Performs object look up by path.

Parameters
relativePathPath of the object where to look at, separated by '.'
Returns
Data object that was found, or null if there was no such object.
void removeModifiedNotificationHandler ( DataContext.ModifiedSubscriptionToken  token)

Removes a modification subscription.

Parameters
tokenToken to identify the subscription that should be removed.