|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.compass.core.converter.mapping.support.FormatDelegateConverter
public class FormatDelegateConverter
A format delegate converter, that creates its own intenral format converter based on the format that it is initalized with.
| Constructor Summary | |
|---|---|
FormatDelegateConverter(String format)
|
|
| Method Summary | |
|---|---|
boolean |
canNormalize()
Returns true if this converter should be used to convert query parser related
values. |
Object |
fromString(String str,
ResourcePropertyMapping resourcePropertyMapping)
Converts from a String and into it's Object representation. |
Converter |
getDelegatedConverter()
|
boolean |
marshall(Resource resource,
Object root,
Mapping mapping,
MarshallingContext context)
Marshall the given Object to the given Resource. |
void |
setDelegatedConverter(Converter delegatedConverter)
Sets a delegated format converter. |
Property.Index |
suggestIndex()
The converter can suggest what type of index will be used in case no index is configured. |
Boolean |
suggestOmitNorms()
The converter can suggest if norms should be saved for this type in case no explicit one is configured. |
Boolean |
suggestOmitTf()
The converter can suggest if tf should be saved for this type in case no explicit one is configured. |
Property.Store |
suggestStore()
The converter can suggest the store type for this type in case no explicit one is configured. |
Property.TermVector |
suggestTermVector()
The converter can suggest if term vectors should be saved for this type in case no explicit one is configured. |
String |
toString(Object o,
ResourcePropertyMapping resourcePropertyMapping)
Converts the Object into a String. |
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 |
| Constructor Detail |
|---|
public FormatDelegateConverter(String format)
| Method Detail |
|---|
public void setDelegatedConverter(Converter delegatedConverter)
FormatConverter.copy() to create a new format converter.
setDelegatedConverter in interface DelegateConverterpublic Converter getDelegatedConverter()
getDelegatedConverter in interface DelegateConverter
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
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
public Object fromString(String str,
ResourcePropertyMapping resourcePropertyMapping)
throws ConversionException
ResourcePropertyConverter
fromString in interface ResourcePropertyConverterstr - The string to convert fromresourcePropertyMapping - The resource property mapping
ConversionException
public String toString(Object o,
ResourcePropertyMapping resourcePropertyMapping)
throws ConversionException
ResourcePropertyConverterNote that toString must be able to handle a null resourcePropertyMapping.
toString in interface ResourcePropertyConvertero - The Object to convert fromresourcePropertyMapping - The resource proeprty mapping
ConversionExceptionpublic boolean canNormalize()
ResourcePropertyConvertertrue if this converter should be used to convert query parser related
values. Conversion is done by calling ResourcePropertyConverter.fromString(String, org.compass.core.mapping.ResourcePropertyMapping)
and then ResourcePropertyConverter.toString(Object, org.compass.core.mapping.ResourcePropertyMapping).
canNormalize in interface ResourcePropertyConverterpublic Property.Index suggestIndex()
ResourcePropertyConverternull and will let global Compass defaults to be used.
suggestIndex in interface ResourcePropertyConverterpublic Property.TermVector suggestTermVector()
ResourcePropertyConverternull and will let global Compass defaults to be used.
suggestTermVector in interface ResourcePropertyConverterpublic Property.Store suggestStore()
ResourcePropertyConverternull and will let global Compass defaults to be used.
suggestStore in interface ResourcePropertyConverterpublic Boolean suggestOmitNorms()
ResourcePropertyConverternull and will let global Compass defaults to be used.
suggestOmitNorms in interface ResourcePropertyConverterpublic Boolean suggestOmitTf()
ResourcePropertyConverternull and will let global Compass defaults to be used.
suggestOmitTf in interface ResourcePropertyConverter
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||