Kanzi  3.9.4
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...
 
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 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() [1/2]

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.

◆ getProperty() [2/2]

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.

Parameters
propertyTypeThe property type identifying the property to retrieve.
enumClassThe class of the enumeration to be used for looking up the constant.
Returns
The property value converted to matching enumeration constant.
See also
KanziObject::getProperty(PropertyType)

◆ 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 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() [1/2]

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.

◆ setProperty() [2/2]

void setProperty ( PropertyType< Integer >  propertyType,
EnumType  value 
)

Sets the local value of an integer property type using a constant from an enumeration.

Parameters
propertyTypeThe property type identifying the property to set.
valueThe enumeration constant to get the integer value from.
See also
KanziObject::setProperty(PropertyType, Object)