Kanzi  3.9.4
Java API
DataObject Class Reference

DataObject is a node in a tree of data. More...

Inheritance diagram for DataObject:
[legend]

Public Member Functions

void addChild (DataObject child)
 Adds data object as child of this object. More...
 
DataObject getChild (int index)
 Retrieves a child object in given index. More...
 
int getChildCount ()
 Retrieves the count of child objects in this data object. More...
 
int getChildIndex (DataObject child)
 Retrieves the index of a child data object. More...
 
String getName ()
 Allows to retrieve the name of the object. More...
 
DataObject getParent ()
 Retrieves the parent DataObject of this DataObject. More...
 
DataObjectType getType ()
 Allows to retrieve the name of the object. More...
 
Object getValue ()
 Gets the value as a boxed Object. More...
 
boolean hasChild (DataObject child)
 Checks whether or not the child exists. More...
 
void insertChild (int index, DataObject child)
 Inserts data object as child of this object, allows to specify index of the object. More...
 
Iterable< DataObjectiterateChildren ()
 Gets an Iterable object used to iterate the DataObject children. More...
 
void removeAllChildren ()
 Removes all children.
 
void removeChild (DataObject child)
 Removes a child object from list of childs. More...
 
void removeChild (int index)
 Removes a child object in given index. More...
 
void setName (String name)
 Sets the name of the DataObject. More...
 
void setParent (DataObject parent)
 Assigns a parent DataObject to this DataObject.
 
- Public Member Functions inherited from DataContext
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...
 
long getNative ()
 Gets a pointer to the backing C++ instance. More...
 
TDataType getOptionalProperty (PropertyType< TDataType > propertyType)
 Returns the current value of a property type, but does not use the default value if there are no inputs to the property value. More...
 
TDataType getProperty (PropertyType< TDataType > propertyType)
 Returns the current value of a property type. More...
 
EnumType getProperty (PropertyType< Integer > propertyType, Class< EnumType > enumClass)
 Returns the current value of an integer property type converted to a matching constant from specified enumeration. More...
 
int hashCode ()
 
boolean hasValue (PropertyType< TDataType > propertyType)
 Evaluates whether there are any inputs into the property value. More...
 
boolean isStale ()
 Test if the object is stale i.e. More...
 
void removeLocalValue (PropertyType< TDataType > propertyType)
 Removes the local value associated with the property. More...
 
void setProperty (PropertyType< TDataType > propertyType, TDataType value)
 Sets the local value of a property type. More...
 
void setProperty (PropertyType< Integer > propertyType, EnumType value)
 Sets the local value of an integer property type using a constant from an enumeration. More...
 

Static Public Member Functions

static< ObjectType extends DataObject > ObjectRef< ObjectType > create (Domain domain, String name)
 Creates a DataObject. More...
 

Static Public Attributes

static final Metaclass metaclass
 The Metaclass for the class. More...
 
- Static Public Attributes inherited from DataContext
static final Metaclass metaclass
 The Metaclass for the class. More...
 
- Static Public Attributes inherited from Resource
static final Metaclass metaclass = com.rightware.kanzi.metadata.ResourceMetadata.metaclass
 The Metaclass for the class.
 
- Static Public Attributes inherited from KanziObject
static final Metaclass metaclass = new AbstractMetaclass("Kanzi.Object")
 The Metaclass for the class.
 

Additional Inherited Members

- Public Attributes inherited from ResourceMetadata
AbstractMetaclass metaclass = new AbstractMetaclass("Kanzi.Resource")
 Metaclass for Resource.
 
- Public Attributes inherited from DataContextMetadata
DynamicPropertyType< ResourceDataContextProperty
 Source of data for this node and its descendants. More...
 
DynamicPropertyType< ResourceItemsSourceProperty
 Data object which provides data sources for list items. More...
 
AbstractMetaclass metaclass = new AbstractMetaclass("Kanzi.DataContext")
 Metaclass for DataContext.
 
- Public Attributes inherited from DataObjectMetadata
AbstractMetaclass metaclass = new AbstractMetaclass("Kanzi.DataObject")
 Metaclass for DataObject.
 

Detailed Description

DataObject is a node in a tree of 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

◆ addChild()

void addChild ( DataObject  child)

Adds data object as child of this object.

Parameters
childChild object to add.

◆ create()

static <ObjectType extends DataObject> ObjectRef<ObjectType> create ( Domain  domain,
String  name 
)
static

Creates a DataObject.

Parameters
domainUI Domain where this DataObject belongs.
nameThe name of the DataObject.

◆ getChild()

DataObject getChild ( int  index)

Retrieves a child object in given index.

Returns
Child data object in given index.

◆ getChildCount()

int getChildCount ( )

Retrieves the count of child objects in this data object.

Returns
Child object count.

◆ getChildIndex()

int getChildIndex ( DataObject  child)

Retrieves the index of a child data object.

Returns
Index of the item in question, throws exception if there is no such child.

◆ getName()

String getName ( )

Allows to retrieve the name of the object.

Returns
Returns the name of the object.

◆ getParent()

DataObject getParent ( )

Retrieves the parent DataObject of this DataObject.

Returns
The parent DataObject of this DataObject.

◆ getType()

DataObjectType getType ( )

Allows to retrieve the name of the object.

Returns
Returns the type of the object.

◆ getValue()

Object getValue ( )

Gets the value as a boxed Object.

Returns
Returns the value as an Object.

◆ hasChild()

boolean hasChild ( DataObject  child)

Checks whether or not the child exists.

Returns
true if there is such child, otherwise false.

◆ insertChild()

void insertChild ( int  index,
DataObject  child 
)

Inserts data object as child of this object, allows to specify index of the object.

Parameters
indexIndex where to add given object.
childChild object to add.

◆ iterateChildren()

Iterable<DataObject> iterateChildren ( )

Gets an Iterable object used to iterate the DataObject children.

Returns
An iterable of DataObject children.

◆ removeChild() [1/2]

void removeChild ( DataObject  child)

Removes a child object from list of childs.

Parameters
childChild object to remove.

◆ removeChild() [2/2]

void removeChild ( int  index)

Removes a child object in given index.

Parameters
indexof the child object to remove.

◆ setName()

void setName ( String  name)

Sets the name of the DataObject.

Parameters
nameThe name

Member Data Documentation

◆ metaclass

final Metaclass metaclass
static
Initial value:

The Metaclass for the class.