Kanzi 3.9.10
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.
 
Metaclass getDynamicMetaclass ()
 Returns the metaclass of the dynamic type of the object.
 
long getNative ()
 Gets a pointer to the backing C++ instance.
 
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.
 
TDataType getProperty (PropertyType< TDataType > propertyType)
 Returns the current value of a property type.
 
int hashCode ()
 
boolean hasValue (PropertyType< TDataType > propertyType)
 Evaluates whether there are any inputs into the property value.
 
boolean isStale ()
 Test if the object is stale i.e.
 
void removeLocalValue (PropertyType< TDataType > propertyType)
 Removes the local value associated with the property.
 
void setProperty (PropertyType< TDataType > propertyType, TDataType value)
 Sets the local value of a property type.
 
ObjectRef< TTypetryCreateObjectRef (Class< TType > clazz)
 Tries to create an owning ObjectRef instance to this KanziObject.
 

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

◆ getDomain()

Domain getDomain ( )

Returns the domain the object belongs to.

Returns
Instance of the domain the object belongs to.

◆ getDynamicMetaclass()

Metaclass getDynamicMetaclass ( )

Returns the metaclass of the dynamic type of the object.

Returns
Metaclass of this node instance.

◆ getNative()

long getNative ( )

Gets a pointer to the backing C++ instance.

Returns
A pointer to the backing C++ instance. Type: kanzi::Object*.

◆ getOptionalProperty()

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.

◆ getProperty()

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.

◆ hasValue()

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.

◆ isStale()

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 com.rightware.kanzi.StaleObjectException.

Returns
True if the object is stale.

◆ removeLocalValue()

void removeLocalValue ( PropertyType< TDataType > propertyType)

Removes the local value associated with the property.

Parameters
propertyTypeThe property type identifying the property to evaluate.

◆ setProperty()

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.

◆ tryCreateObjectRef()

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.