Kanzi  3.9.7
Java API
KanziObject Class Reference

Object is the base class for Kanzi UI classes that implement association with a Domain. More...

Inheritance diagram for KanziObject:
[legend]

Classes

class  Iterator
 

Public Member Functions

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...
 
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...
 
ObjectRef< TType > tryCreateObjectRef (Class< TType > clazz)
 Tries to create an owning ObjectRef instance to this KanziObject. More...
 

Static Public Attributes

static final Metaclass metaclass = new AbstractMetaclass("Kanzi.Object")
 The Metaclass for the class.
 

Detailed Description

Object is the base class for Kanzi UI classes that implement association with a Domain.

Member Function Documentation

Domain getDomain ( )

Returns the domain the object belongs to.

Returns
Instance of the domain the object belongs to.
Metaclass getDynamicMetaclass ( )

Returns the metaclass of the dynamic type of the object.

Returns
Metaclass of this node instance.
long getNative ( )

Gets a pointer to the backing C++ instance.

Returns
A pointer to the backing C++ instance. Type: kanzi::Object*.
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.

This method returns a value that is the result of the property system evaluating the inputs that can affect the values of properties. It calculates the final value by determining the base value of the property and applying existing modifiers to it.

Base value is affected by the following inputs where the highest entry in the list determines the base value:

  1. Local value set with setProperty or loaded from kzb.
  2. Value set by a style affecting the property.
  3. Value defined by class metadata.

When the base value is determined the system applies modifiers to the value that can change the value or replace it completely. The following is the list of possible modifiers, where the order of evaluation is determined by the order the modifiers were added or applied:

  1. Values defined is states of state manager.
  2. Animations.

It is not possible to use this method to determine if a Resource type property is actually set with the value of null, or if it is unset and null is returned. The KanziObject.hasValue() method can be used with a property of Resource type.

Parameters
propertyTypeThe property type identifying the property to retrieve.
<TDataType>Data type of the property, optional.
Returns
Returns the evaluated property value, or null if the property was not present.
TDataType getProperty ( PropertyType< TDataType >  propertyType)

Returns the current value of a property type.

This function returns a value that is the result of the property system evaluating the inputs that can affect the values of properties. It calculates the final value by determining the base value of the property and applying existing modifiers to it.

Base value is affected by the following inputs where the highest entry in the list determines the base value:

  1. Local value set with setProperty or loaded from kzb
  2. Value set by a style affecting the property.
  3. Value defined by class metadata.

When the base value is determined the system applies modifiers to the value that can change the value or replace it completely. The following is the list of possible modifiers, where the order of evaluation is determined by the order the modifiers were added or applied.

  1. Values defined is states of state manager.
  2. Animations.

If no inputs to the property value can be established the system returns the value registered in the property type metadata.

Parameters
propertyTypeThe property type identifying the property to retrieve.
<TDataType>Data type of the property, optional.
Returns
Returns the evaluated property value.
boolean hasValue ( PropertyType< TDataType >  propertyType)

Evaluates whether there are any inputs into the property value.

Both value sources and modifiers are taken into account.

Parameters
propertyTypeThe property type identifying the property to evaluate.
Returns
Returns true if there are inputs into the property value, false otherwise.
boolean isStale ( )

Test if the object is stale i.e.

the backing native object has been deleted. Most usage of a stale object will throw a StaleObjectException.

Returns
True if the object is stale.
void removeLocalValue ( PropertyType< TDataType >  propertyType)

Removes the local value associated with the property.

Parameters
propertyTypeThe property type identifying the property to evaluate.
void setProperty ( PropertyType< TDataType >  propertyType,
TDataType  value 
)

Sets the local value of a property type.

Parameters
propertyTypeThe property type identifying the property to set.
valuevalue The value to set.
<TDataType>Defines the data type of the property, optional.
ObjectRef<TType> tryCreateObjectRef ( Class< TType >  clazz)

Tries to create an owning ObjectRef instance to this KanziObject.

If the object is already stale, returns null.

If the object type does not match the provided class, throws a ClassCastException.

Parameters
clazzThe type of the KanziObject.
<TType>The KanziObject type.
Returns
Owning ObjectRef instance. If the object is stale, returns null.