|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.converter.basic.AbstractBasicConverter
org.compass.core.converter.dynamic.AbstractDynamicConverter
public abstract class AbstractDynamicConverter
A simple base class for DynamicConverter. Requires implementation of
evaluate(Object,org.compass.core.mapping.ResourcePropertyMapping).
FormatConverter for expression that return formatable
objects (like Date).
| Field Summary |
|---|
| Fields inherited from interface org.compass.core.converter.dynamic.DynamicConverter |
|---|
DATA_CONTEXT_KEY |
| Constructor Summary | |
|---|---|
AbstractDynamicConverter()
|
|
| Method Summary | |
|---|---|
protected void |
addProperty(Object value,
ResourcePropertyMapping resourcePropertyMapping,
SearchEngine searchEngine,
Object root,
MarshallingContext context,
Resource resource)
|
DynamicConverter |
copy()
Copies over the dynamic converter. |
protected abstract Object |
evaluate(Object o,
ResourcePropertyMapping resourcePropertyMapping)
Evaluates the given data object using the configured expression. |
Object |
fromString(String str,
ResourcePropertyMapping resourcePropertyMapping)
Does nothing since there is no meaning for un-marshalling for dynamic converters |
Class |
getType()
The return type of the evaluated expression. |
boolean |
marshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
Marshall the given Object to the given Resource. |
void |
setFormatConverter(FormatConverter formatConverter)
If the dynamic expression evaluates to a formatable object (like Date), the format converter that will be used to format it. |
void |
setType(Class type)
The return type of the evaluated expression. |
Object |
unmarshall(Resource resource,
Mapping mapping,
MarshallingContext context)
Does nothing since there is no meaning for un-marshalling for dynamic converters |
| Methods inherited from class org.compass.core.converter.basic.AbstractBasicConverter |
|---|
doSetBoost, getNullValue, handleNulls, isNullValue, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.compass.core.converter.dynamic.DynamicConverter |
|---|
setExpression |
| Constructor Detail |
|---|
public AbstractDynamicConverter()
| Method Detail |
|---|
public DynamicConverter copy()
DynamicConverter
copy in interface DynamicConverterpublic void setFormatConverter(FormatConverter formatConverter)
DynamicConverter
setFormatConverter in interface DynamicConverter
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 Convertermarshall in class AbstractBasicConverterresource - 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 void addProperty(Object value,
ResourcePropertyMapping resourcePropertyMapping,
SearchEngine searchEngine,
Object root,
MarshallingContext context,
Resource resource)
protected abstract Object evaluate(Object o,
ResourcePropertyMapping resourcePropertyMapping)
throws ConversionException
o - The data objectresourcePropertyMapping - The resource mapping
ConversionException
public Object unmarshall(Resource resource,
Mapping mapping,
MarshallingContext context)
throws ConversionException
unmarshall in interface Converterunmarshall in class AbstractBasicConverterresource - 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
public Object fromString(String str,
ResourcePropertyMapping resourcePropertyMapping)
throws ConversionException
fromString in interface ResourcePropertyConverterstr - The string to convert fromresourcePropertyMapping - The resource property mapping
ConversionExceptionpublic Class getType()
DynamicConverter
getType in interface DynamicConverterpublic void setType(Class type)
DynamicConverter
setType in interface DynamicConverter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||