JADE Java Persistence API
1.0

com.jadeworld.jade.rootschema
Class JadeDynamicObject

java.lang.Object
  extended by com.jadeworld.jade.rootschema.Object
      extended by com.jadeworld.jade.rootschema.JadeDynamicObject

public class JadeDynamicObject
extends Object

The transient JadeDynamicObject class implements the structure and behavior of dynamic objects. A JADE dynamic object is a self-describing object whose attributes are determined at run time. The JadeDynamicObject class has two fixed attributes: type and name, which you can use to determine the runtime type of a dynamic object.


Field Summary
 
Fields inherited from class com.jadeworld.jade.rootschema.Object
oid
 
Constructor Summary
JadeDynamicObject()
          Creates a new instance of JadeDynamicObject
 
Method Summary
 boolean addProperty(java.lang.String propertyName, java.lang.String propertyType)
          Adds the property with the specified name and type to the receiver at run time.
 void clear()
          Clears the contents of the receiver at run time, by deleting all user-defined properties added by calling the addProperty method and all values set by calling the setPropertyValue method.
 void clearValues()
          Clears the contents of values assigned to the receiver using the setPropertyValue method to set the value to null.
 JadeDynamicObjectArray getChildren()
          Returns the array of dynamic child objects.
 java.lang.String getName()
          Returns the runtime name of the JadeDynamicObject instance in textual format.
 JadeDynamicObject getParent()
          Returns the parent of this dynamic object.
 int getPropertyCount()
          Returns the number of dynamically defined properties for the receiver.
 java.lang.String getPropertyName(int index)
          Returns a string containing the name of the property at the relative index specified in the index parameter.
 java.lang.String getPropertyType(java.lang.String name)
          Returns a string containing the name of the JADE type of the property specified in the name parameter.
 java.lang.String getPropertyTypeByIndex(int index)
          Returns a string containing the name of the JADE type of the property at the relative index specified in the index parameter.
 java.lang.Object getPropertyValue(java.lang.String name)
          Returns the value of the property specified in the name parameter.
 java.lang.Object getPropertyValueByIndex(int index)
          Returns the value of the property at the relative index specified in the index parameter.
 int getType()
          Returns the runtime type of the JadeDynamicObject instance.
 void setName(java.lang.String name)
          Sets the runtime name of the JadeDynamicObject.
 void setParent(JadeDynamicObject parent)
          Set the parent of this dynamic object, which automatically adds this instance to the children property of the parent object instance.
 void setPropertyValue(java.lang.String name, java.lang.Object value)
          Sets the value of the property specified in the name parameter to the value specified in the value parameter at run time.
 void setPropertyValueByIndex(int index, java.lang.Object value)
          Sets the value of the property of the property at the relative index specified in the index parameter.
 void setType(int type)
          Sets the runtime type of the JadeDynamicObject instance.
 
Methods inherited from class com.jadeworld.jade.rootschema.Object
changeObjectVolatility, creationTime, edition, equals, exclusiveLock, getClassNumberForObject, getInstanceIdForObject, getLockStatus, getObjectStringForObject, getObjectVolatility, getOidString, getOidStringForObject, hashCode, hasMembers, isImportedObject, isKindOf, isLockedByMe, isObjectFrozen, isObjectNonSharedTransient, isObjectPersistent, isObjectSharedTransient, isObjectStable, isObjectTransient, isObjectVolatile, isSharedTransient, isSystemObject, isTransient, latestEdition, lock, makeObjectFrozen, makeObjectStable, makeObjectVolatile, reserveLock, sdeCauseEvent, sdsCauseEvent, setPropertyValue, sharedLock, toString, tryLock, unlock, updateObjectEdition
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

JadeDynamicObject

public JadeDynamicObject()
Creates a new instance of JadeDynamicObject

Method Detail

getName

public java.lang.String getName()
Returns the runtime name of the JadeDynamicObject instance in textual format.

Overrides:
getName in class Object
Returns:
The JadeDynamicObject name property value.

setName

public void setName(java.lang.String name)
Sets the runtime name of the JadeDynamicObject.

Parameters:
name - The JadeDynamicObject name property

getType

public int getType()
Returns the runtime type of the JadeDynamicObject instance.

Returns:
The JadeDynamicObject type property value.

setType

public void setType(int type)
Sets the runtime type of the JadeDynamicObject instance.

Parameters:
type - The JadeDynamicObject type value

getChildren

public JadeDynamicObjectArray getChildren()
Returns the array of dynamic child objects. These can be added by explicitly adding to this collection or by setting the parent property (the inverse of the relationship) of the child object to this object.


getParent

public JadeDynamicObject getParent()
Returns the parent of this dynamic object. This can be null. This object can be added to the children property of another dynamic object instance, by setting the parent property of that instance.

Returns:
The JadeDynamicObject parent property value.

setParent

public void setParent(JadeDynamicObject parent)
Set the parent of this dynamic object, which automatically adds this instance to the children property of the parent object instance.

Parameters:
parent - The JadeDynamicObject parent property value.

addProperty

public boolean addProperty(java.lang.String propertyName,
                           java.lang.String propertyType)
Adds the property with the specified name and type to the receiver at run time. An exception is raised if the value of the name parameter conflicts with an existing fixed or dynamic property name.

Parameters:
propertyName - The name of the property to be added.
propertyType - The JADEe type of the property to be added.
Returns:
true if the propertyType parameter is a valid JADE type; otherwise false.

clear

public void clear()
Clears the contents of the receiver at run time, by deleting all user-defined properties added by calling the addProperty method and all values set by calling the setPropertyValue method.


clearValues

public void clearValues()
Clears the contents of values assigned to the receiver using the setPropertyValue method to set the value to null. All property descriptions added to the receiver using the addProperty method are retained. As a side effect, any dynamic memory assigned to store variable-length string or binary values is released.


getPropertyName

public java.lang.String getPropertyName(int index)
Returns a string containing the name of the property at the relative index specified in the index parameter. If the value of the index parameter is outside the range 1 through getPropertyCount(), an exception is raised.

Parameters:
index - The property index.
Returns:
The corresponding property name.

getPropertyType

public java.lang.String getPropertyType(java.lang.String name)
Returns a string containing the name of the JADE type of the property specified in the name parameter. If the receiver does not define the property name, an exception is raised.

Parameters:
name - The property name.
Returns:
The corresponding property type name.

getPropertyTypeByIndex

public java.lang.String getPropertyTypeByIndex(int index)
Returns a string containing the name of the JADE type of the property at the relative index specified in the index parameter. If the value of the index parameter is outside the range 1 through getPropertyCount(), an exception is raised.

Parameters:
index - The property index.
Returns:
The corresponding property type name.

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.String name)
Returns the value of the property specified in the name parameter. If the receiver does not define the property name, an exception is raised.

Overrides:
getPropertyValue in class Object
Parameters:
name - The name of the property.
Returns:
The corresponding property value.

getPropertyValueByIndex

public java.lang.Object getPropertyValueByIndex(int index)
Returns the value of the property at the relative index specified in the index parameter. If the value of the index parameter is outside the range 1 through getPropertyCount(), an exception is raised.

Parameters:
index - The property index.
Returns:
The corresponding property value.

getPropertyCount

public int getPropertyCount()
Returns the number of dynamically defined properties for the receiver.

Returns:
The number of properties.

setPropertyValue

public void setPropertyValue(java.lang.String name,
                             java.lang.Object value)
Sets the value of the property specified in the name parameter to the value specified in the value parameter at run time.

Parameters:
name - The property name.
value - The corresponding property value to set.

setPropertyValueByIndex

public void setPropertyValueByIndex(int index,
                                    java.lang.Object value)
Sets the value of the property of the property at the relative index specified in the index parameter. If the value of the index parameter is outside the range 1 through getPropertyCount(), an exception is raised.

Parameters:
index - The property index.
value - The corresponding property value to set.

JADE Java Persistence API
1.0

Copyright © 2007 Jade Software Corporation