com.agfa.hap.sdo.implementation
Class AbstractPartialDataObject

java.lang.Object
  extended by com.agfa.hap.sdo.implementation.AbstractDataObject
      extended by com.agfa.hap.sdo.implementation.AbstractPartialDataObject
All Implemented Interfaces:
ContainedDataObject, PartialDataObject, DataObject, java.io.Serializable
Direct Known Subclasses:
DataObjectImplementation

public abstract class AbstractPartialDataObject
extends AbstractDataObject
implements PartialDataObject

See Also:
Serialized Form

Field Summary
protected  boolean isSettingProperty
           
 
Fields inherited from class com.agfa.hap.sdo.implementation.AbstractDataObject
logger, type
 
Fields inherited from interface com.agfa.hap.sdo.PartialDataObject
UNAVAILABLE_PROPERTY
 
Constructor Summary
protected AbstractPartialDataObject(Type type)
           
protected AbstractPartialDataObject(Type type, DataGraph dataGraph)
           
 
Method Summary
protected abstract  java.lang.Object basicGet(Property property)
          Returns the value of the property.
protected abstract  void basicSet(Property property, java.lang.Object value)
           
 PartialDataObject createDataObject(int propertyIndex)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 PartialDataObject createDataObject(int propertyIndex, java.lang.String namespaceURI, java.lang.String typeName)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 PartialDataObject createDataObject(Property property)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 PartialDataObject createDataObject(Property property, Type type)
          Returns a new data object contained by this object using the specified property, which must be of containment type.
 PartialDataObject createDataObject(java.lang.String propertyName)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 PartialDataObject createDataObject(java.lang.String propertyName, java.lang.String namespaceURI, java.lang.String typeName)
          Returns a new data object contained by this object using the specified property, which must be a containment property.
 java.lang.Object get(Property property)
          Returns the value of the given property of this object.
 PartialDataObject getContainer()
          Returns the containing data object or null if there is no container.
 Property getContainmentProperty()
          Return the Property of the data object containing this data object or null if there is no container.
 PartialDataObject getDataObject(int propertyIndex)
          Returns the value of a DataObject property identified by the specified property index.
 PartialDataObject getDataObject(Property property)
          Returns the value of the specified DataObject property.
 PartialDataObject getDataObject(java.lang.String path)
          Returns the value of a DataObject property identified by the specified path.
 java.lang.Object getIdentity()
           
protected abstract  java.util.List initializeWithEmptyList(Property property)
           
 boolean isAvailable(Property property)
           
 boolean isProxy()
           
 boolean isSet(Property property)
          Returns whether the property of the object is considered to be set.
protected  java.util.List<java.lang.Object> safeGetList(Property property)
           
 void set(Property property, java.lang.Object value)
          Sets the value of the given property of the object to the new value.
 void setIdentity(java.lang.Object value)
          Sets the value of the identity property for this instance.
 void setList(Property property, java.util.List value)
          Sets the value of the specified List property, to the specified value.
 void setUnavailable(Property property)
          Strips the property such that is no longer available.
 void unset(Property property)
          Unsets the property of the object.
 
Methods inherited from class com.agfa.hap.sdo.implementation.AbstractDataObject
debugString, delete, detach, get, get, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getBytes, getBytes, getBytes, getChangeSummary, getChar, getChar, getChar, getDataGraph, getDate, getDate, getDate, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInstanceProperties, getInstanceProperty, getInt, getInt, getInt, getList, getList, getList, getLong, getLong, getLong, getProperty, getRootObject, getSequence, getSequence, getSequence, getSequence, getShort, getShort, getShort, getString, getString, getString, getType, isContained, isSet, isSet, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBigInteger, setBoolean, setBoolean, setBoolean, setByte, setByte, setByte, setBytes, setBytes, setBytes, setChar, setChar, setChar, setContainment, setDataGraph, setDataObject, setDataObject, setDataObject, setDate, setDate, setDate, setDouble, setDouble, setDouble, setFloat, setFloat, setFloat, setInt, setInt, setInt, setList, setList, setLong, setLong, setLong, setShort, setShort, setShort, setString, setString, setString, unset, unset, writeReplace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.agfa.hap.sdo.PartialDataObject
getType
 
Methods inherited from interface commonj.sdo.DataObject
delete, detach, get, get, getBigDecimal, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getBytes, getBytes, getBytes, getChangeSummary, getChar, getChar, getChar, getDataGraph, getDate, getDate, getDate, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInstanceProperties, getInstanceProperty, getInt, getInt, getInt, getList, getList, getList, getLong, getLong, getLong, getProperty, getRootObject, getSequence, getSequence, getSequence, getSequence, getShort, getShort, getShort, getString, getString, getString, isSet, isSet, set, set, setBigDecimal, setBigDecimal, setBigDecimal, setBigInteger, setBigInteger, setBigInteger, setBoolean, setBoolean, setBoolean, setByte, setByte, setByte, setBytes, setBytes, setBytes, setChar, setChar, setChar, setDataObject, setDataObject, setDataObject, setDate, setDate, setDate, setDouble, setDouble, setDouble, setFloat, setFloat, setFloat, setInt, setInt, setInt, setList, setList, setLong, setLong, setLong, setShort, setShort, setShort, setString, setString, setString, unset, unset
 

Field Detail

isSettingProperty

protected boolean isSettingProperty
Constructor Detail

AbstractPartialDataObject

protected AbstractPartialDataObject(Type type)

AbstractPartialDataObject

protected AbstractPartialDataObject(Type type,
                                    DataGraph dataGraph)
Method Detail

basicGet

protected abstract java.lang.Object basicGet(Property property)
Returns the value of the property. In case the property is not accessible returns PartialDataObject.UNAVAILABLE_PROPERTY.


basicSet

protected abstract void basicSet(Property property,
                                 java.lang.Object value)

get

public java.lang.Object get(Property property)
Description copied from interface: DataObject
Returns the value of the given property of this object.

If the property is many-valued, the result will be a List and each object in the List will be an instance of the property's type. Otherwise the result will directly be an instance of the property's type.

Specified by:
get in interface DataObject
Parameters:
property - the property of the value to fetch.
Returns:
the value of the given property of the object.
See Also:
DataObject.set(Property, Object), DataObject.unset(Property), DataObject.isSet(Property)

set

public void set(Property property,
                java.lang.Object value)
Description copied from interface: DataObject
Sets the value of the given property of the object to the new value.

If the property is many-valued, the new value must be a List and each object in that list must be an instance of the property's type; the existing contents are cleared and the contents of the new value are added. Otherwise the new value directly must be an instance of the property's type and it becomes the new value of the property of the object.

Specified by:
set in interface DataObject
Parameters:
property - the property of the value to set.
value - the new value for the property.
See Also:
DataObject.unset(Property), DataObject.isSet(Property), DataObject.get(Property)

createDataObject

public PartialDataObject createDataObject(java.lang.String propertyName)
Description copied from interface: DataObject
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is the declared type of the specified property.

Specified by:
createDataObject in interface PartialDataObject
Specified by:
createDataObject in interface DataObject
Parameters:
propertyName - the name of the specified containment property.
Returns:
the created data object.
See Also:
DataObject.createDataObject(String, String, String)

createDataObject

public PartialDataObject createDataObject(int propertyIndex)
Description copied from interface: DataObject
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is the declared type of the specified property.

Specified by:
createDataObject in interface PartialDataObject
Specified by:
createDataObject in interface DataObject
Parameters:
propertyIndex - the index of the specified containment property.
Returns:
the created data object.
See Also:
DataObject.createDataObject(int, String, String)

createDataObject

public PartialDataObject createDataObject(Property property)
Description copied from interface: DataObject
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is the declared type of the specified property.

Specified by:
createDataObject in interface PartialDataObject
Specified by:
createDataObject in interface DataObject
Parameters:
property - the specified containment property.
Returns:
the created data object.
See Also:
DataObject.createDataObject(Property, Type)

createDataObject

public PartialDataObject createDataObject(java.lang.String propertyName,
                                          java.lang.String namespaceURI,
                                          java.lang.String typeName)
Description copied from interface: DataObject
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is specified by the packageURI and typeName arguments. The specified type must be a compatible target for the property identified by propertyName.

Specified by:
createDataObject in interface PartialDataObject
Specified by:
createDataObject in interface DataObject
Parameters:
propertyName - the name of the specified containment property.
namespaceURI - the namespace URI of the package containing the type of object to be created.
typeName - the name of a type in the specified package.
Returns:
the created data object.
See Also:
DataObject.createDataObject(String), DataGraph.getType(java.lang.String, java.lang.String)

createDataObject

public PartialDataObject createDataObject(int propertyIndex,
                                          java.lang.String namespaceURI,
                                          java.lang.String typeName)
Description copied from interface: DataObject
Returns a new data object contained by this object using the specified property, which must be a containment property. The type of the created object is specified by the packageURI and typeName arguments. The specified type must be a compatible target for the property identified by propertyIndex.

Specified by:
createDataObject in interface PartialDataObject
Specified by:
createDataObject in interface DataObject
Parameters:
propertyIndex - the index of the specified containment property.
namespaceURI - the namespace URI of the package containing the type of object to be created.
typeName - the name of a type in the specified package.
Returns:
the created data object.
See Also:
DataObject.createDataObject(int), DataGraph.getType(java.lang.String, java.lang.String)

createDataObject

public PartialDataObject createDataObject(Property property,
                                          Type type)
Description copied from interface: DataObject
Returns a new data object contained by this object using the specified property, which must be of containment type. The type of the created object is specified by the type argument, which must be a compatible target for the speicifed property.

Specified by:
createDataObject in interface PartialDataObject
Specified by:
createDataObject in interface DataObject
Parameters:
property - a containment property of this object.
type - the type of object to be created.
Returns:
the created data object.
See Also:
DataObject.createDataObject(int)

safeGetList

protected java.util.List<java.lang.Object> safeGetList(Property property)

initializeWithEmptyList

protected abstract java.util.List initializeWithEmptyList(Property property)

setList

public void setList(Property property,
                    java.util.List value)
Description copied from interface: DataObject
Sets the value of the specified List property, to the specified value.

The new value must be a List and each object in that list must be an instance of the property's type; the existing contents are cleared and the contents of the new value are added.

Specified by:
setList in interface DataObject
Overrides:
setList in class AbstractDataObject
Parameters:
property - the property to set.
value - the new value for the property.
See Also:
DataObject.set(Property, Object)

getDataObject

public PartialDataObject getDataObject(int propertyIndex)
Description copied from interface: DataObject
Returns the value of a DataObject property identified by the specified property index.

Specified by:
getDataObject in interface PartialDataObject
Specified by:
getDataObject in interface DataObject
Parameters:
propertyIndex - the index of the property.
Returns:
the DataObject value of the specified property.
See Also:
DataObject.get(int)

getDataObject

public PartialDataObject getDataObject(Property property)
Description copied from interface: DataObject
Returns the value of the specified DataObject property.

Specified by:
getDataObject in interface PartialDataObject
Specified by:
getDataObject in interface DataObject
Parameters:
property - the property to get.
Returns:
the DataObject value of the specified property.
See Also:
DataObject.get(Property)

getDataObject

public PartialDataObject getDataObject(java.lang.String path)
Description copied from interface: DataObject
Returns the value of a DataObject property identified by the specified path.

Specified by:
getDataObject in interface PartialDataObject
Specified by:
getDataObject in interface DataObject
Parameters:
path - the path to a valid object and property.
Returns:
the DataObject value of the specified property.
See Also:
DataObject.get(String)

getContainmentProperty

public Property getContainmentProperty()
Description copied from interface: DataObject
Return the Property of the data object containing this data object or null if there is no container.

Specified by:
getContainmentProperty in interface PartialDataObject
Specified by:
getContainmentProperty in interface DataObject
Overrides:
getContainmentProperty in class AbstractDataObject
Returns:
the property containing this data object.

getContainer

public PartialDataObject getContainer()
Description copied from interface: DataObject
Returns the containing data object or null if there is no container.

Specified by:
getContainer in interface PartialDataObject
Specified by:
getContainer in interface DataObject
Overrides:
getContainer in class AbstractDataObject
Returns:
the containing data object or null.

getIdentity

public java.lang.Object getIdentity()
Specified by:
getIdentity in interface PartialDataObject
Returns:
The value of the identity property for this instance.

setIdentity

public void setIdentity(java.lang.Object value)
Description copied from interface: PartialDataObject
Sets the value of the identity property for this instance.

Specified by:
setIdentity in interface PartialDataObject

isAvailable

public boolean isAvailable(Property property)
Specified by:
isAvailable in interface PartialDataObject

setUnavailable

public void setUnavailable(Property property)
Description copied from interface: PartialDataObject
Strips the property such that is no longer available.

Specified by:
setUnavailable in interface PartialDataObject

isSet

public boolean isSet(Property property)
Description copied from interface: DataObject
Returns whether the property of the object is considered to be set.

isSet() for many-valued Properties returns true if the List is not empty and false if the List is empty. For single-valued Properties it returns true if the Property has been set() and not unset(), and false otherwise. Any call to set() without a call to unset() will cause isSet() to return true, regardless of the value being set. For example, after calling set(property, property.getDefault()) on a previously unset property, isSet(property) will return true, even though the value of get(property) will be unchanged.

Specified by:
isSet in interface DataObject
Parameters:
property - the property in question.
Returns:
whether the property of the object is set.
See Also:
DataObject.set(Property, Object), DataObject.unset(Property), DataObject.get(Property)

unset

public void unset(Property property)
Description copied from interface: DataObject
Unsets the property of the object.

If the property is many-valued, the value must be an List and that list is cleared. Otherwise, the value of the property of the object is set to the property's default value. The property will no longer be considered set.

Specified by:
unset in interface DataObject
Parameters:
property - the property in question.
See Also:
DataObject.isSet(Property), DataObject.set(Property, Object), DataObject.get(Property)

isProxy

public boolean isProxy()
Specified by:
isProxy in interface PartialDataObject
Returns:
If this data object is a proxy. Proxies only have their identity property available.


Copyright © 2007. All Rights Reserved.