|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.converter.mapping.osem.ClassMappingConverter
public class ClassMappingConverter
| Nested Class Summary | |
|---|---|
protected static class |
ClassMappingConverter.IdentityAliasedObjectKey
An object key based on the alias and the object identity hash code |
protected static class |
ClassMappingConverter.IdsAliasesObjectKey
An object key based on the alias and its ids values |
| Field Summary | |
|---|---|
static String |
DISABLE_INTERNAL_MAPPINGS
|
static String |
ROOT_CLASS_MAPPING_KEY
|
| Constructor Summary | |
|---|---|
ClassMappingConverter()
|
|
| Method Summary | |
|---|---|
protected Object |
constructObjectForUnmarshalling(ClassMapping classMapping,
Resource resource)
Constructs the object used for unmarshalling (no properties are set/unmarshalled) on it. |
protected boolean |
doMarshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
|
protected void |
doSetBoost(Resource resource,
Object root,
ClassMapping classMapping,
MarshallingContext context)
A simple extension point that allows to set the boost value for the created Resource. |
protected String |
getPolyClassName(Object root)
An extension point allowing to get the poly class name if need to be stored. |
boolean |
marshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
Marshall the given Object to the given Resource. |
boolean |
marshallIds(Resource idResource,
Object id,
ResourceMapping resourceMapping,
MarshallingContext context)
|
protected void |
storePolyClass(Resource resource,
Object root,
SearchEngine searchEngine,
ClassMapping classMapping)
Stores the poly class name callback. |
Object |
unmarshall(Resource resource,
Mapping mapping,
MarshallingContext context)
Unmarshall the given Resource to the appropiate Object. |
Object[] |
unmarshallIds(Object id,
ResourceMapping resourceMapping,
MarshallingContext context)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ROOT_CLASS_MAPPING_KEY
public static final String DISABLE_INTERNAL_MAPPINGS
| Constructor Detail |
|---|
public ClassMappingConverter()
| Method Detail |
|---|
public boolean marshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
throws ConversionException
ConverterObject 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).
marshall in interface Converterresource - 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
true if data was saved in the the index that can be read.
ConversionException
protected boolean doMarshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
throws ConversionException
ConversionException
public Object unmarshall(Resource resource,
Mapping mapping,
MarshallingContext context)
throws ConversionException
ConverterResource to the appropiate Object.
unmarshall in interface Converterresource - 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
ConversionException
protected Object constructObjectForUnmarshalling(ClassMapping classMapping,
Resource resource)
throws ConversionException
null return value denotes no un-marshalling should be performed.
ConversionException
public boolean marshallIds(Resource idResource,
Object id,
ResourceMapping resourceMapping,
MarshallingContext context)
throws ConversionException
marshallIds in interface ResourceMappingConverterConversionException
public Object[] unmarshallIds(Object id,
ResourceMapping resourceMapping,
MarshallingContext context)
throws ConversionException
unmarshallIds in interface ResourceMappingConverterConversionException
protected void doSetBoost(Resource resource,
Object root,
ClassMapping classMapping,
MarshallingContext context)
throws ConversionException
Resource.
The default implemenation uses the statically defined boost value in the mapping definition
(AbstractResourceMapping.getBoost()) to set the boost level
using Resource.setBoost(float)
Note, that this method will only be called on a root level (root=true) mapping.
resource - The resource to set the boost onroot - The Object that is marshalled into the respective ResourceclassMapping - The Class Mapping deifnitioncontext - The marshalling context
ConversionException
protected void storePolyClass(Resource resource,
Object root,
SearchEngine searchEngine,
ClassMapping classMapping)
getPolyClassName(Object) in order to get
the poly class and store it.
resource - The resource to add the poly class toroot - The root class to write its class namesearchEngine - The search engine to useclassMapping - The class mapping to useprotected String getPolyClassName(Object root)
Class.getName().
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||