com.agfa.hap.sdo.mapper
Class DelegatingPartialDataObjectMapper<T>

java.lang.Object
  extended by com.agfa.hap.sdo.mapper.DelegatingPartialDataObjectMapper<T>
All Implemented Interfaces:
DataMapper<T>

public class DelegatingPartialDataObjectMapper<T>
extends java.lang.Object
implements DataMapper<T>

Author:
awvjz this datamapper wraps another datamapper and delegates to this second mapper in case the object it has to work with are not partialdataobjects

Constructor Summary
DelegatingPartialDataObjectMapper(DataMapper<T> delegateDataMapper)
           
 
Method Summary
 T create(Type type)
           
 Type getCorrespondingType(java.lang.Class clazz)
           
 java.util.Iterator<? extends T> getObjects(T object, Property property)
           
 java.util.Collection<T> getProperties(java.util.Collection<T> object, Property bulkProperty, SnapshotDefinition def)
          Return the corresponding values for this bulk property for the given object.
 java.lang.Object getProperty(T object, Property property)
           
 Type getType(T object)
           
 boolean isBulkProperty(java.lang.Class clazz, Property property)
           
 boolean isProxy(T object)
           
 T newProxy(Type type, java.lang.Object identity)
          Create a new proxy.
 void setProperty(T object, Property property, java.lang.Object value)
          Assigns the given value to the property of the object.
 void setUnavailable(T 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

DelegatingPartialDataObjectMapper

public DelegatingPartialDataObjectMapper(DataMapper<T> delegateDataMapper)
Method Detail

create

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

getCorrespondingType

public Type getCorrespondingType(java.lang.Class clazz)
Specified by:
getCorrespondingType in interface DataMapper<T>
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.

getProperty

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

newProxy

public T 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<T>
Returns:
null if the datamapper is unable to create a proxy for the given type

getObjects

public java.util.Iterator<? extends T> getObjects(T object,
                                                  Property property)
Specified by:
getObjects in interface DataMapper<T>
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)

getType

public Type getType(T object)
Specified by:
getType in interface DataMapper<T>
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.

isProxy

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

setProperty

public void setProperty(T 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<T>

setUnavailable

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

Specified by:
setUnavailable in interface DataMapper<T>

getProperties

public java.util.Collection<T> getProperties(java.util.Collection<T> 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<T>

isBulkProperty

public boolean isBulkProperty(java.lang.Class clazz,
                              Property property)
Specified by:
isBulkProperty in interface DataMapper<T>
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.