|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.tenduke.types.AbstractBindableObject
public abstract class AbstractBindableObject
Base class for classes that support binding / persistent storage: e.g. storing in relation database using Jdbc, java persistence or similar.
Bindable objects features:
ObjectStateChange,
SerializableObject| Field Summary | |
|---|---|
static int |
FIELD_LENGTH_SHORT_ID
Field length for the short, human-friendly id. |
static java.lang.String |
FIELD_NAME_OBJECT_STATE_CHANGE
Constant that names field for defining object state change. |
static java.lang.String |
FIELD_NAME_REPLACES_OBJECT
Constant that names field that holds object that is replaced in a model state change. |
static java.lang.String |
FIELD_NAME_SHORT_ID
Field name for the short, human-friendly id. |
static long |
PERMISSION_ACTION_CREATE
Permission action required for creating new objects. |
static long |
PERMISSION_ACTION_DELETE
Permission action required for deleting objects. |
static long |
PERMISSION_ACTION_MODIFY
Permission action required for modifying existing objects. |
static long |
PERMISSION_ACTION_READ
Permission action required for reading / querying objects. |
| Constructor Summary | |
|---|---|
AbstractBindableObject()
|
|
| Method Summary | ||
|---|---|---|
|
addRelatedObject(java.lang.Class<U> relationType,
java.lang.String relationName,
T obj)
Adds an object to the list of related objects by given relation type and relation name. |
|
|
addRelatedObject(java.lang.Class<U> relationType,
T obj)
Adds an object to the list of related objects by given relation type. |
|
|
addRelatedObject(ObjectRelation<T,U> relation,
T obj)
Adds an object to the list of related objects by given relation. |
|
|
addRelatedObject(U relationAttributeObject,
java.lang.String relationName,
T obj)
Adds an object to the list of related objects by given relation type and relation name. |
|
|
addRelatedObjects(java.lang.Class<U> relationType,
java.util.List<T> objects)
Adds all objects in the given list to the list of related objects by given relation type. |
|
|
addRelatedObjects(java.lang.Class<U> relationType,
java.lang.String relationName,
java.util.List<T> objects)
Adds all objects in the given list to the list of related objects by given relation type and relation name. |
|
|
addRelatedObjects(ObjectRelation<T,U> relation,
java.util.List<T> objects)
Adds all objects in the given list to the list of related objects by given relation. |
|
protected void |
copyThis(AbstractBindableObject result)
Utility for use in Object.clone implementation. |
|
abstract java.util.Date |
getCreated()
Get created timestamp. |
|
abstract BindableObjectActor |
getCreatingActor()
Get actor that has created the object. |
|
static
|
getFirstObjectById(java.util.List<U> objects,
java.util.UUID id)
Gets an object from the given list of objects by id. |
|
java.lang.Long |
getGrantedObjectPermissionActions()
Gets permission actions granted for handling the object in current context. |
|
abstract java.util.UUID |
getId()
Gets object's unique id. |
|
abstract java.util.Date |
getModified()
Gets the timestamp when object was modified. |
|
abstract BindableObjectActor |
getModifyingActor()
Get actor that has modified the object. |
|
java.util.UUID |
getObjectCategoryId()
Get object's category id. |
|
AbstractBindableObject |
getParent()
Gets this objects parent. |
|
java.lang.String |
getParentBindableType()
Gets type to be used as parent bindable object. |
|
java.util.List<java.lang.String> |
getParentBindableTypeChain()
Follows parent chain of this object and for each parent found, adds its getParentBindableType() to the list, starting from
this object. |
|
java.util.UUID |
getParentId()
Gets id of parent object. |
|
SerializableObject |
getParentNode()
Gets this objects parent object. |
|
java.lang.String |
getParentType()
Gets type of parent object as fully qualified class name. |
|
java.util.List<AbstractBindableObject> |
getRelatedObjectList()
Gets flat list of all objects related to this object via old-style static named relations. |
|
java.util.List<AbstractBindableObject> |
getRelatedObjectList(java.lang.String relationName)
Gets list of related objects with given old-style static relation name. |
|
java.util.Map<java.lang.String,java.util.List<AbstractBindableObject>> |
getRelatedObjectLists()
Gets old-style static relations for this object. |
|
static java.util.Map<java.lang.String,java.util.List<AbstractBindableObject>> |
getRelatedObjectLists(AbstractBindableObject object)
Gets old-style static relations for the given object. |
|
java.util.Map<ObjectRelation<? extends AbstractBindableObject,? extends AbstractBindableObject>,java.util.List<? extends AbstractBindableObject>> |
getRelatedObjects()
Gets objects related to this object. |
|
|
getRelatedObjects(java.lang.Class<U> relationType,
java.lang.Class<T> relatedObjectType)
Gets objects related to this object with given relation type. |
|
|
getRelatedObjects(java.lang.Class<U> relationType,
java.lang.String relationName,
java.lang.Class<T> relatedObjectType)
Gets objects related to this object with given relation type and relation name. |
|
|
getRelatedObjects(ObjectRelation<T,U> relation)
Gets objects related to this object with given relation. |
|
java.util.List<? extends AbstractBindableObject> |
getRelatedObjects(java.lang.String relationName)
Gets objects related to this object with given relation relation name and any relation type. |
|
|
getRelatedObjects(java.lang.String relationName,
java.lang.Class<T> relatedObjectType)
Gets objects related to this object with given relation relation name and any relation type. |
|
|
getRelationAttributeObject(java.lang.Class<U> relationAttributeObjectType)
Gets object that is an attribute of a relation from another object to this object. |
|
|
getRelationField(java.lang.Class<T> fieldValueClass,
java.lang.String fieldName)
Gets value of a field in relation attribute object. |
|
ObjectRelationHandler |
getRelationHandler()
Gets handler that encapsulates object dynamic relations. |
|
java.lang.Class<? extends AbstractBindableObject> |
getRelationType(java.lang.String relationName)
Gets type of relation with given relation name. |
|
AbstractBindableObject |
getReplaces()
Handle to object that is replaced in a model state change. |
|
java.lang.String |
getShortId()
Gets short id of the object. |
|
java.lang.Integer |
getStateChange()
Gets instance member for state change flag (default value for an object instance is ObjectStateChange.UNDEFINED). |
|
|
hasRelatedObjects(ObjectRelation<T,U> relation)
Does this object have related objects with given relation. |
|
boolean |
hasRelatedObjects(java.lang.String relationName)
Does this object have related objects with given relation name. |
|
protected void |
resolveParentBindableType()
Resolves and sets getParentBindableType() based on currently set parent object. |
|
protected java.lang.String |
resolveParentBindableTypeByTreeParent()
Gets parent bindable object type for the object by iterating parents in the current object tree. |
|
abstract void |
setCreated(java.util.Date created)
Set created timestamp. |
|
abstract void |
setCreatingActor(BindableObjectActor actor)
Set actor that has created the object. |
|
void |
setGrantedObjectPermissionActions(java.lang.Long grantedObjectPermissionActions)
Sets permission actions granted for handling the object in current context. |
|
abstract void |
setId(java.util.UUID identifier)
Sets object's unique id. |
|
abstract void |
setModified(java.util.Date modified)
Set modified timestamp. |
|
abstract void |
setModifyingActor(BindableObjectActor actor)
Set actor that has modified the object. |
|
void |
setObjectCategoryId(java.util.UUID categoryId)
Set object's category id. |
|
void |
setParent(AbstractBindableObject parent)
Set parent object, i.e. |
|
static void |
setParent(java.util.List<? extends AbstractBindableObject> objects,
AbstractBindableObject parent)
Set parent object for each object in list, i.e. |
|
void |
setParentBindableType(java.lang.String parentBindableType)
Sets type to be used as parent bindable object. |
|
void |
setParentNode(SerializableObject parent)
Set parent object, i.e. |
|
void |
setRelatedObjectList(java.lang.String relationName,
java.util.List<AbstractBindableObject> relationList)
Sets value of old-style static @FieldName(relationName) annotated field in this object to relationList. |
|
|
setRelatedObjects(java.lang.Class<? extends AbstractBindableObject> relationType,
java.util.List<T> objects)
Sets the list of related objects with given relation type, replacing earlier related objects for the relation. |
|
|
setRelatedObjects(java.lang.Class<? extends AbstractBindableObject> relationType,
java.lang.String relationName,
T object)
Sets the list of related objects with given relation type and relation name, replacing earlier related objects for the relation, to the single object. |
|
|
setRelatedObjects(java.lang.Class<? extends AbstractBindableObject> relationType,
T object)
Sets the list of related objects with given relation type, replacing earlier related objects for the relation, to the single object. |
|
|
setRelatedObjects(java.lang.Class<U> relationType,
java.lang.String relationName,
java.util.List<T> objects)
Sets the list of related objects with given relation type and relation name, replacing earlier related objects for the relation. |
|
|
setRelatedObjects(ObjectRelation<T,U> relation,
java.util.List<T> objects)
Sets the list of related objects with given relation, replacing earlier related objects for the relation. |
|
|
setRelatedObjects(ObjectRelation<T,U> relation,
T object)
Sets the list of related objects with given relation, replacing earlier related objects for the relation, to the single object. |
|
|
setRelationAttributeObject(U relationAttributeObject)
Gets object that is an attribute of a relation from another object to this object. |
|
void |
setRelationHandler(ObjectRelationHandler relationHandler)
Sets handler that encapsulates object dynamic relations. |
|
void |
setReplaces(AbstractBindableObject replaces)
Handle to object that is replaced in a model state change. |
|
void |
setShortId(java.lang.String shortId)
Sets short id of the object. |
|
void |
setStateChange(java.lang.Integer stateChange)
Sets instance member for state change flag (default value for an object instance is ObjectStateChange.UNDEFINED). |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int FIELD_LENGTH_SHORT_ID
public static final java.lang.String FIELD_NAME_OBJECT_STATE_CHANGE
ObjectStateChange:
public static final java.lang.String FIELD_NAME_REPLACES_OBJECT
Constant that names field that holds object that is replaced in a model state change.
Requirements:
ObjectStateChange.REPLACE_SPECIFIED:
delete relations from specified object to other
specific objects and add a relation to new specified object
(delete relations from object1 to object2.getReplaces()
and add relation from object1 to object2):
use object2 instance, where object2's and object2's replaces
instances id shall be set.
ObjectStateChange.REPLACE_ALL:
delete relations from specified object to all other
objects by type and add relation to specified object
(delete all relations from object1 to
objects of type class2 and add relation to an specified
instance of class2): use an instance of class2
with null id in object2's replaces member. Object2's id
shall be set to allow creating the new relation.
public static final java.lang.String FIELD_NAME_SHORT_ID
public static final long PERMISSION_ACTION_CREATE
public static final long PERMISSION_ACTION_DELETE
public static final long PERMISSION_ACTION_MODIFY
public static final long PERMISSION_ACTION_READ
| Constructor Detail |
|---|
public AbstractBindableObject()
| Method Detail |
|---|
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void addRelatedObject(java.lang.Class<U> relationType,
java.lang.String relationName,
T obj)
Adds an object to the list of related objects by given relation type and relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related object.relationType - Type of relation.relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.obj - Object to be added to the relation.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void addRelatedObject(java.lang.Class<U> relationType,
T obj)
Adds an object to the list of related objects by given relation type.
This overload creates relation description (instance of ObjectRelation) with given relation type and null
(default) relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related object.relationType - Type of relation.obj - Object to be added to the relation.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void addRelatedObject(ObjectRelation<T,U> relation,
T obj)
Adds an object to the list of related objects by given relation.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related object.relation - Description of relation. Relation description may be defined dynamically in the context where relations are
associated and used.obj - Object to be added to the relation.
public <T extends RelationObject,U extends AbstractBindableObject> void addRelatedObject(U relationAttributeObject,
java.lang.String relationName,
T obj)
Adds an object to the list of related objects by given relation type and relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related object.U - Type of relation attribute object.relationAttributeObject - Relation attribute object.relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.obj - Object to be added to the relation.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void addRelatedObjects(java.lang.Class<U> relationType,
java.util.List<T> objects)
Adds all objects in the given list to the list of related objects by given relation type.
This overload creates relation description (instance of ObjectRelation) with given relation type and null
(default) relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relationType - Type of relation.objects - List of objects to be added to the relation.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void addRelatedObjects(java.lang.Class<U> relationType,
java.lang.String relationName,
java.util.List<T> objects)
Adds all objects in the given list to the list of related objects by given relation type and relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relationType - Type of relation.relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.objects - List of objects to be added to the relation.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void addRelatedObjects(ObjectRelation<T,U> relation,
java.util.List<T> objects)
Adds all objects in the given list to the list of related objects by given relation.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relation - Description of relation. Relation description may be defined dynamically in the context where relations are
associated and used.objects - List of objects to be added to the relation.protected void copyThis(AbstractBindableObject result)
result - The object who's fields will be set by
values from this instance.public abstract java.util.Date getCreated()
public abstract BindableObjectActor getCreatingActor()
public static <U extends AbstractBindableObject> U getFirstObjectById(java.util.List<U> objects,
java.util.UUID id)
U - Object type.objects - List of objects.id - Object id.
public java.lang.Long getGrantedObjectPermissionActions()
AbstractBindableObject.public abstract java.util.UUID getId()
getId in interface SerializableObjectpublic abstract java.util.Date getModified()
public abstract BindableObjectActor getModifyingActor()
public java.util.UUID getObjectCategoryId()
public AbstractBindableObject getParent()
public java.lang.String getParentBindableType()
public java.util.List<java.lang.String> getParentBindableTypeChain()
getParentBindableType() to the list, starting from
this object. Breaks on first object that doesn't have parent bindable object type defined,
i.e. there will be no nulls in the returned list.
public java.util.UUID getParentId()
public SerializableObject getParentNode()
getParentNode in interface SerializableObjectpublic java.lang.String getParentType()
public java.util.List<AbstractBindableObject> getRelatedObjectList()
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
public java.util.List<AbstractBindableObject> getRelatedObjectList(java.lang.String relationName)
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
relationName -
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
public java.util.Map<java.lang.String,java.util.List<AbstractBindableObject>> getRelatedObjectLists()
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
public static java.util.Map<java.lang.String,java.util.List<AbstractBindableObject>> getRelatedObjectLists(AbstractBindableObject object)
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.IllegalAccessExceptionpublic java.util.Map<ObjectRelation<? extends AbstractBindableObject,? extends AbstractBindableObject>,java.util.List<? extends AbstractBindableObject>> getRelatedObjects()
Gets objects related to this object. Map key is description of the relation (assigned dynamically in the context where this field is used), map value is List of objects related to this object with the named relation.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> java.util.List<T> getRelatedObjects(java.lang.Class<U> relationType,
java.lang.Class<T> relatedObjectType)
Gets objects related to this object with given relation type.
This overload creates relation description (instance of ObjectRelation) with given relation type and null
(default) relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relationType - Relation type.relatedObjectType - Type of related objects.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> java.util.List<T> getRelatedObjects(java.lang.Class<U> relationType,
java.lang.String relationName,
java.lang.Class<T> relatedObjectType)
Gets objects related to this object with given relation type and relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relationType - Relation type.relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.relatedObjectType - Type of related objects.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> java.util.List<T> getRelatedObjects(ObjectRelation<T,U> relation)
Gets objects related to this object with given relation.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
relation - Description of the relation.
public java.util.List<? extends AbstractBindableObject> getRelatedObjects(java.lang.String relationName)
Gets objects related to this object with given relation relation name and any relation type.
This overload provides untyped access to a related object list. Use getRelatedObjects(java.lang.String, java.lang.Class)
for typed access.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.
public <T extends AbstractBindableObject> java.util.List<T> getRelatedObjects(java.lang.String relationName,
java.lang.Class<T> relatedObjectType)
Gets objects related to this object with given relation relation name and any relation type.
This overload provides typed access to a related object list. Use getRelatedObjects(java.lang.String) for untyped access.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.relatedObjectType - Type of related objects.
public <U> U getRelationAttributeObject(java.lang.Class<U> relationAttributeObjectType)
getRelationAttributeObject in interface RelationObjectU - Type of the relation attribute object.relationAttributeObjectType - Class of the relation attribute object.
public <T> T getRelationField(java.lang.Class<T> fieldValueClass,
java.lang.String fieldName)
relation attribute object.
Type conversion is provided with no runtime error checking.
T - Type of relation field's value object.fieldValueClass - The class of the field value object.fieldName - Name of the relation field.
public ObjectRelationHandler getRelationHandler()
getRelationHandler in interface RelationObjectpublic java.lang.Class<? extends AbstractBindableObject> getRelationType(java.lang.String relationName)
Gets type of relation with given relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.
public AbstractBindableObject getReplaces()
Handle to object that is replaced in a model state change. Requirements for the instance:
ObjectStateChange.REPLACE_SPECIFIED:
delete relations from specified object to other
specific objects and add a relation to new specified object
(delete relations from object1 to object2.getReplaces()
and add relation from object1 to object2):
use object2 instance, where object2's and object2's replaces
instances id shall be set.
ObjectStateChange.REPLACE_ALL:
delete relations from specified object to all other
objects by type and add relation to specified object
(delete all relations from object1 to
objects of type class2 and add relation to an specified
instance of class2): use an instance of class2
with null id in object2's replaces member. Object2's id
shall be set to allow creating the new relation.
public java.lang.String getShortId()
public java.lang.Integer getStateChange()
ObjectStateChange.UNDEFINED).
public <T extends AbstractBindableObject,U extends AbstractBindableObject> boolean hasRelatedObjects(ObjectRelation<T,U> relation)
T - Type of related objects.relation - Relation description.
public boolean hasRelatedObjects(java.lang.String relationName)
relationName - Relation name.
protected void resolveParentBindableType()
getParentBindableType() based on currently set parent object. Called by getParent() after setting
parent, parent type and parent id. This default implementation sets the newly set value of getParentType() to the
parent bindable object type. May be overridden by derived classes.
protected java.lang.String resolveParentBindableTypeByTreeParent()
Gets parent bindable object type for the object by iterating parents in the current object tree. This method may be used in
resolveParentBindableType() overrides for classes that want to suggest parent based bind naming that's different from
the resolveParentBindableType default implementation.
The following conditions are applied when resolving parent bindable object type:
public abstract void setCreated(java.util.Date created)
created - The date (timestamp) when object was created.public abstract void setCreatingActor(BindableObjectActor actor)
actor - Handle to actor that created this object.public void setGrantedObjectPermissionActions(java.lang.Long grantedObjectPermissionActions)
grantedObjectPermissionActions - Permission actions granted, bitmask of PERMISSION_ACTION values defined by
AbstractBindableObject.public abstract void setId(java.util.UUID identifier)
setId in interface SerializableObjectidentifier - Unique id for this object.public abstract void setModified(java.util.Date modified)
modified - The date (timestamp) when object was modified.public abstract void setModifyingActor(BindableObjectActor actor)
actor - Handle to actor that modified this object.public void setObjectCategoryId(java.util.UUID categoryId)
categoryId - The category id to set.public void setParent(AbstractBindableObject parent)
parent - Handle to parent object.
public static void setParent(java.util.List<? extends AbstractBindableObject> objects,
AbstractBindableObject parent)
- parent - Handle to parent object.public void setParentBindableType(java.lang.String parentBindableType)
parentBindableType - Fully qualified name of class to be used as parent bindable type.public void setParentNode(SerializableObject parent)
setParentNode in interface SerializableObjectparent - Handle to parent object (shall be of type AbstractBindableObject).
public void setRelatedObjectList(java.lang.String relationName,
java.util.List<AbstractBindableObject> relationList)
throws java.lang.IllegalArgumentException,
java.lang.IllegalAccessException
relationName - relationList -
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
public <T extends AbstractBindableObject> void setRelatedObjects(java.lang.Class<? extends AbstractBindableObject> relationType,
java.util.List<T> objects)
Sets the list of related objects with given relation type, replacing earlier related objects for the relation.
This overload creates relation description (instance of ObjectRelation) with given relation type and null
(default) relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relationType - Type of relation.objects - List of objects to be set as related objects with given relation name.
public <T extends AbstractBindableObject> void setRelatedObjects(java.lang.Class<? extends AbstractBindableObject> relationType,
java.lang.String relationName,
T object)
Sets the list of related objects with given relation type and relation name, replacing earlier related objects for the relation, to the single object.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related object.relationType - Type of relation.relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.object - Object to be set as the only related object with given relation name.
public <T extends AbstractBindableObject> void setRelatedObjects(java.lang.Class<? extends AbstractBindableObject> relationType,
T object)
Sets the list of related objects with given relation type, replacing earlier related objects for the relation, to the single object.
This overload creates relation description (instance of ObjectRelation) with given relation type and null
(default) relation name.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related object.relationType - Type of relation.object - Object to be set as the only related object with given relation name.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void setRelatedObjects(java.lang.Class<U> relationType,
java.lang.String relationName,
java.util.List<T> objects)
Sets the list of related objects with given relation type and relation name, replacing earlier related objects for the relation.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relationType - Type of relation.relationName - Name of relation. May be null. For null relation name default relation naming may be used e.g. for binding.objects - List of objects to be set as related objects with given relation name.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void setRelatedObjects(ObjectRelation<T,U> relation,
java.util.List<T> objects)
Sets the list of related objects with given relation, replacing earlier related objects for the relation.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related objects.relation - Description of relation. Relation description may be defined dynamically in the context where relations are
associated and used.objects - List of objects to be set as related objects with given relation name.
public <T extends AbstractBindableObject,U extends AbstractBindableObject> void setRelatedObjects(ObjectRelation<T,U> relation,
T object)
Sets the list of related objects with given relation, replacing earlier related objects for the relation, to the single object.
Methods of this class that handle related objects can be used for dynamic relations between any objects that derive from AbstractBindableObject. Derived classes may also explicitly define relations.
T - Type of related object.relation - Description of relation. Relation description may be defined dynamically in the context where relations are
associated and used.object - Object to be set as the only related object with given relation name.public <U> void setRelationAttributeObject(U relationAttributeObject)
setRelationAttributeObject in interface RelationObjectU - Type of the relation attribute object.relationAttributeObject - Object that is an attribute of a relation from another object to this object.public void setRelationHandler(ObjectRelationHandler relationHandler)
setRelationHandler in interface RelationObjectrelationHandler - ObjectRelationHandler that encapsulated object dynamic relationspublic void setReplaces(AbstractBindableObject replaces)
Handle to object that is replaced in a model state change. Requirements for the instance:
ObjectStateChange.REPLACE_SPECIFIED::
delete relations from specified object to other
specific objects and add a relation to new specified object
(delete relations from object1 to object2.getReplaces()
and add relation from object1 to object2):
use object2 instance, where object2's and object2's replaces
instances id shall be set.
ObjectStateChange.REPLACE_ALL:
delete relations from specified object to all other
objects by type and add relation to specified object
(delete all relations from object1 to
objects of type class2 and add relation to an specified
instance of class2): use an instance of class2
with null id in object2's replaces member. Object2's id
shall be set to allow creating the new relation.
replaces - Object (prototype) instance that describes replaced.public void setShortId(java.lang.String shortId)
shortId - Short idpublic void setStateChange(java.lang.Integer stateChange)
ObjectStateChange.UNDEFINED).
stateChange - the state change value to set.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||