com.agfa.hap.sdo.mapper
Class PartialDataObjectMapper

java.lang.Object
  extended by com.agfa.hap.sdo.mapper.PartialDataObjectMapper
All Implemented Interfaces:
DataMapper<PartialDataObject>
Direct Known Subclasses:
FilteringPartialDataObjectMapper

public class PartialDataObjectMapper
extends java.lang.Object
implements DataMapper<PartialDataObject>

Default implementation that only support object that are instances of PartialDataObject.

Author:
AMOCZ

Constructor Summary
PartialDataObjectMapper()
           
 
Method Summary
 PartialDataObject create(Type type)
           
 Type getCorrespondingType(java.lang.Class clazz)
           
 java.util.Iterator<PartialDataObject> getObjects(PartialDataObject object, Property property)
           
 java.util.Collection<PartialDataObject> getProperties(java.util.Collection<PartialDataObject> object, Property bulkProperty, SnapshotDefinition def)
          Return the corresponding values for this bulk property for the given object.
 java.lang.Object getProperty(PartialDataObject object, Property property)
           
 Type getType(PartialDataObject object)
           
 boolean isBulkProperty(java.lang.Class clazz, Property property)
           
 boolean isProxy(PartialDataObject object)
           
 PartialDataObject newProxy(Type type, java.lang.Object identity)
          Create a new proxy.
 void setProperty(PartialDataObject object, Property property, java.lang.Object value)
          Assigns the given value to the property of the object.
 void setUnavailable(PartialDataObject object, Property property)
          Marks a property as unavailable (PartialDataObject#isAvailable(Property)}.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PartialDataObjectMapper

public PartialDataObjectMapper()
Method Detail

getObjects

public java.util.Iterator<PartialDataObject> getObjects(PartialDataObject object,
                                                        Property property)
Specified by:
getObjects in interface DataMapper<PartialDataObject>
Returns:
An iterator over all values of this property of the given Object. Property should be a many-valued property. returns an "empty" iterator in case the property is null (SDO doesn't have the concept of a many valued property that can be null)

getProperty

public java.lang.Object getProperty(PartialDataObject object,
                                    Property property)
Specified by:
getProperty in interface DataMapper<PartialDataObject>
Returns:
The value of the property for the given object.

getType

public Type getType(PartialDataObject object)
Specified by:
getType in interface DataMapper<PartialDataObject>
Returns:
The sdo type that corresponds with this object. It is assumed that for all properties of this type, appropriate values can be retrieved from the instance.

getCorrespondingType

public Type getCorrespondingType(java.lang.Class clazz)
Specified by:
getCorrespondingType in interface DataMapper<PartialDataObject>
Returns:
The sdo type that corresponds with this class. It is assumed that for all properties of this type, appropriate values can be retrieved from the instance.

setProperty

public void setProperty(PartialDataObject object,
                        Property property,
                        java.lang.Object value)
Description copied from interface: DataMapper
Assigns the given value to the property of the object. If the property is many-valued, adds the property to the collection of values.

Specified by:
setProperty in interface DataMapper<PartialDataObject>

setUnavailable

public void setUnavailable(PartialDataObject object,
                           Property property)
Description copied from interface: DataMapper
Marks a property as unavailable (PartialDataObject#isAvailable(Property)}.

Specified by:
setUnavailable in interface DataMapper<PartialDataObject>

create

public PartialDataObject create(Type type)
Specified by:
create in interface DataMapper<PartialDataObject>
Returns:
A newly created instance of which the class corresponds to the given type.
See Also:
DataMapper.getCorrespondingType(Class)

newProxy

public PartialDataObject newProxy(Type type,
                                  java.lang.Object identity)
Description copied from interface: DataMapper
Create a new proxy. The type is passed as parameter as this accessor might be usable for multiple types.

Specified by:
newProxy in interface DataMapper<PartialDataObject>
Returns:
null if the datamapper is unable to create a proxy for the given type

isProxy

public boolean isProxy(PartialDataObject object)
Specified by:
isProxy in interface DataMapper<PartialDataObject>

getProperties

public java.util.Collection<PartialDataObject> getProperties(java.util.Collection<PartialDataObject> object,
                                                             Property bulkProperty,
                                                             SnapshotDefinition def)
Description copied from interface: DataMapper
Return the corresponding values for this bulk property for the given object. A snapshotdefinition is passed as indication for which child objects are needed as well.

Specified by:
getProperties in interface DataMapper<PartialDataObject>

isBulkProperty

public boolean isBulkProperty(java.lang.Class clazz,
                              Property property)
Specified by:
isBulkProperty in interface DataMapper<PartialDataObject>
Returns:
if this property is a bulk property for the given implementation clazz. Bulk properties are accessed in bulk (@see DataMapper.getProperties(Collection, Property, SnapshotDefinition) to allow more efficient retrieval.


Copyright © 2007. All Rights Reserved.