|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.marshall.DefaultMarshallingStrategy
public class DefaultMarshallingStrategy
| Constructor Summary | |
|---|---|
DefaultMarshallingStrategy(CompassMapping mapping,
SearchEngine searchEngine,
ConverterLookup converterLookup,
InternalCompassSession session)
|
|
| Method Summary | |
|---|---|
Resource |
marshall(Object root)
Marshalls the given Object into a Resource based on the ResourceMapping
associated with the provided object. |
Resource |
marshall(String alias,
Object root)
Marshalls the given Object into a Resource based on the ResourceMapping
associated with the provided alias. |
Resource |
marshallIds(Class clazz,
Object id)
Marshalls the give id object into a Resource (a resource having only its ids set). |
Resource |
marshallIds(Object id)
Marshalls the given id object into a Resource (a resource having only its ids set). |
void |
marshallIds(Object root,
Object id)
Marhsalls the give id into the actual object. |
Resource |
marshallIds(ResourceMapping resourceMapping,
Object id)
Marshalls the give id object into a Resource (a resource having only its ids set). |
void |
marshallIds(ResourceMapping resourceMapping,
Object root,
Object id)
Marhsalls the give id into the actual object. |
boolean |
marshallIds(Resource resource,
ResourceMapping resourceMapping,
Object id,
MarshallingContext context)
Marshalls the give id object into the provided Resource (a resource having only its ids set). |
Resource |
marshallIds(String alias,
Object id)
Marshalls the give id object into a Resource (a resource having only its ids set). |
Object |
unmarshall(Resource resource)
Unmarshalls the given resource to an Object based on the ResourceMapping
regsitered under the Resource alias. |
Object |
unmarshall(Resource resource,
MarshallingContext context)
Unmarshalls the given resource to an Object based on the ResourceMapping
regsitered under the Resource alias WITHIN the given marshalling context. |
Object[] |
unmarshallIds(Class clazz,
Object id)
Unmarshalls the given id object into an array of all the id values. |
Object[] |
unmarshallIds(ResourceMapping resourceMapping,
Object id,
MarshallingContext context)
Unmarshalls the given id object into an array of all the id values. |
Object[] |
unmarshallIds(String alias,
Object id)
Unmarshalls the given id object into an array of all the id values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultMarshallingStrategy(CompassMapping mapping,
SearchEngine searchEngine,
ConverterLookup converterLookup,
InternalCompassSession session)
| Method Detail |
|---|
public Resource marshallIds(Object id)
MarshallingStrategyMarshalls the given id object into a Resource (a resource having only its ids set). Note, that the id can be several types, depending on the mapping. For example, for class mapping, it can be the root Object itself (with its ids set), an array of ids, or if a single id, the actual id object.
The ResourceMapping are looked up based on the given object.
Will return null if no mappins are found
marshallIds in interface MarshallingStrategyid - The id to marshall into a Resource
public Resource marshallIds(String alias,
Object id)
MarshallingStrategyMarshalls the give id object into a Resource (a resource having only its ids set). Note, that the id can be several types, depending on the mapping. For example, for class mapping, it can be the root Object itself (with its ids set), an array of ids, or if a single id, the actual id object.
The ResourceMapping are looked up based on the given alias.
Will return null if no mappins are found
marshallIds in interface MarshallingStrategyalias - The alias to look up the ResourceMapping basedid - The id to marshall into a Resource
public Resource marshallIds(Class clazz,
Object id)
MarshallingStrategyMarshalls the give id object into a Resource (a resource having only its ids set). Note, that the id can be several types, depending on the mapping. For example, for class mapping, it can be the root Object itself (with its ids set), an array of ids, or if a single id, the actual id object.
The ResourceMapping are looked up based on the given class.
Will return null if no mappins are found
marshallIds in interface MarshallingStrategyclazz - The class to look up the ResourceMapping basedid - The id to marshall into a Resource
public Resource marshallIds(ResourceMapping resourceMapping,
Object id)
MarshallingStrategy
marshallIds in interface MarshallingStrategyresourceMapping - The resource mapping holding how to marhsall the idsid - The id to marshall into a Resource
public boolean marshallIds(Resource resource,
ResourceMapping resourceMapping,
Object id,
MarshallingContext context)
MarshallingStrategy
marshallIds in interface MarshallingStrategyresource - The resource to marhsll the ids intoresourceMapping - The resource mapping holding how to marhsall the idsid - The id to marshall into a Resource
true if stored properties were added to the Resource.
public void marshallIds(Object root,
Object id)
MarshallingStrategy
marshallIds in interface MarshallingStrategyroot - The object to marshall the ids intoid - The id to marshall into the root object
public void marshallIds(ResourceMapping resourceMapping,
Object root,
Object id)
MarshallingStrategy
marshallIds in interface MarshallingStrategyresourceMapping - The resource mapping for the given objectroot - The object to marshall the ids intoid - The id to marshall into the root object
public Object[] unmarshallIds(String alias,
Object id)
MarshallingStrategyResourceMapping associated with the given
alias.
unmarshallIds in interface MarshallingStrategyalias - The alias to lookup the ResourceMappingid - The id to unmarshall
public Object[] unmarshallIds(Class clazz,
Object id)
MarshallingStrategyResourceMapping associated with the given
class.
unmarshallIds in interface MarshallingStrategyclazz - The class to lookup the ResourceMappingid - The id to unmarshall
public Object[] unmarshallIds(ResourceMapping resourceMapping,
Object id,
MarshallingContext context)
MarshallingStrategyResourceMapping provided.
unmarshallIds in interface MarshallingStrategyresourceMapping - The resource to perform the unmarshalling based onid - The id to unmarshall
public Resource marshall(String alias,
Object root)
MarshallingStrategyResource based on the ResourceMapping
associated with the provided alias. Returns null if there are no mappings.
marshall in interface MarshallingStrategyalias - The alias to look up the ResourceMappingroot - The object to marshall into the resource
null if has no mappingpublic Resource marshall(Object root)
MarshallingStrategyResource based on the ResourceMapping
associated with the provided object. If the object implements AliasedObject,
the alias will be used to look up the ResourceMapping, otherwise, the object class will be used.
marshall in interface MarshallingStrategyroot - The object to marshall into a resource
public Object unmarshall(Resource resource)
throws CompassException
MarshallingStrategyResourceMapping
regsitered under the Resource alias.
unmarshall in interface MarshallingStrategyresource - The resource to unmarshall from
CompassException
public Object unmarshall(Resource resource,
MarshallingContext context)
throws CompassException
MarshallingStrategyResourceMapping
regsitered under the Resource alias WITHIN the given marshalling context.
unmarshall in interface MarshallingStrategyresource - The resource to unmarshall fromcontext - The context to unmarshall the resource within
CompassException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||