org.compass.core.converter.mapping.osem
Class AbstractCollectionMappingConverter
java.lang.Object
org.compass.core.converter.mapping.osem.AbstractCollectionMappingConverter
- All Implemented Interfaces:
- Converter
- Direct Known Subclasses:
- ArrayMappingConverter, CollectionMappingConverter
public abstract class AbstractCollectionMappingConverter
- extends Object
- implements Converter
- Author:
- kimchy
|
Method Summary |
protected abstract void |
addValue(Object col,
int index,
Object value,
AbstractCollectionMapping mapping,
MarshallingContext context)
|
protected abstract Object |
createColObject(Getter getter,
AbstractCollectionMapping.CollectionType collectionType,
int size,
AbstractCollectionMapping mapping,
MarshallingContext context)
|
protected abstract AbstractCollectionMapping.CollectionType |
getRuntimeCollectionType(Object root)
|
boolean |
marshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
Marshall the given Object to the given Resource. |
protected abstract int |
marshallIterateData(Object root,
AbstractCollectionMapping colMapping,
Resource resource,
MarshallingContext context)
Marhall the data, returning the number of elements that were actually stored in the index
(and can later be read). |
Object |
unmarshall(Resource resource,
Mapping mapping,
MarshallingContext context)
Unmarshall the given Resource to the appropiate Object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
COLLECTION_RESOURCE_WRAPPER_KEY
public static final String COLLECTION_RESOURCE_WRAPPER_KEY
- See Also:
- Constant Field Values
AbstractCollectionMappingConverter
public AbstractCollectionMappingConverter()
marshall
public boolean marshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
throws ConversionException
- Description copied from interface:
Converter
- Marshall the given
Object to the given Resource. Will use
the mapping definition as to how to marshall the object.
Returns true if data was saved in the index, and it can
be read as well (i.e. stored).
- Specified by:
marshall in interface Converter
- Parameters:
resource - The resource to marhsall the object toroot - The Object to marshall to the resourcemapping - The mapping definition of how to marshall the Object to the resorucecontext - The context for the current marhslling process
- Returns:
true if data was saved in the the index that can be read.
- Throws:
ConversionException
getRuntimeCollectionType
protected abstract AbstractCollectionMapping.CollectionType getRuntimeCollectionType(Object root)
marshallIterateData
protected abstract int marshallIterateData(Object root,
AbstractCollectionMapping colMapping,
Resource resource,
MarshallingContext context)
- Marhall the data, returning the number of elements that were actually stored in the index
(and can later be read).
unmarshall
public Object unmarshall(Resource resource,
Mapping mapping,
MarshallingContext context)
throws ConversionException
- Description copied from interface:
Converter
- Unmarshall the given
Resource to the appropiate Object.
- Specified by:
unmarshall in interface Converter
- Parameters:
resource - The resource to unmarshall into an Objectmapping - The mapping definition of how to unmarshall the Resource into an Objectcontext - The context for the current marshalling process
- Returns:
- The object unmarshalled
- Throws:
ConversionException
createColObject
protected abstract Object createColObject(Getter getter,
AbstractCollectionMapping.CollectionType collectionType,
int size,
AbstractCollectionMapping mapping,
MarshallingContext context)
addValue
protected abstract void addValue(Object col,
int index,
Object value,
AbstractCollectionMapping mapping,
MarshallingContext context)
Copyright (c) 2004-2008 The Compass Project.