org.compass.core.converter.mapping.json
Class RootJsonObjectMappingConverter
java.lang.Object
org.compass.core.converter.mapping.json.AbstractDynamicJsonMappingConverter
org.compass.core.converter.mapping.json.AbstractJsonObjectMappingConverter
org.compass.core.converter.mapping.json.RootJsonObjectMappingConverter
- All Implemented Interfaces:
- Converter, ResourceMappingConverter
public class RootJsonObjectMappingConverter
- extends AbstractJsonObjectMappingConverter
- implements ResourceMappingConverter
- Author:
- kimchy
|
Method Summary |
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)
Marshalls teh given Object id into the given resource. |
Object |
unmarshall(Resource resource,
Mapping mapping,
MarshallingContext context)
Unmarshall the given Resource to the appropiate Object. |
Object[] |
unmarshallIds(Object id,
ResourceMapping resourceMapping,
MarshallingContext context)
Unamrshalls the given id into its id properties values. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
RootJsonObjectMappingConverter
public RootJsonObjectMappingConverter()
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
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
marshallIds
public boolean marshallIds(Resource idResource,
Object id,
ResourceMapping resourceMapping,
MarshallingContext context)
throws ConversionException
- Description copied from interface:
ResourceMappingConverter
- Marshalls teh given
Object id into the given resource. Returns true
if anything was was stored in the resource.
- Specified by:
marshallIds in interface ResourceMappingConverter
- Throws:
ConversionException
unmarshallIds
public Object[] unmarshallIds(Object id,
ResourceMapping resourceMapping,
MarshallingContext context)
throws ConversionException
- Description copied from interface:
ResourceMappingConverter
- Unamrshalls the given id into its id properties values.
- Specified by:
unmarshallIds in interface ResourceMappingConverter
- Throws:
ConversionException
Copyright (c) 2004-2008 The Compass Project.