org.compass.core.converter.mapping
Interface ResourcePropertyConverter

All Superinterfaces:
Converter
All Known Subinterfaces:
FormatConverter
All Known Implementing Classes:
AbstractBasicConverter, AbstractDynamicConverter, AbstractFormatConverter, AbstractNumberConverter, AtomicBooleanConverter, AtomicIntConverter, AtomicLongConverter, BigDecimalConverter, BigIntegerConverter, BooleanConverter, ByteConverter, CalendarConverter, CharConverter, DateConverter, DoubleConverter, EnumConverter, FileConverter, FloatConverter, FormatDelegateConverter, GroovyDynamicConverter, IntConverter, JakartaElDynamicConverter, JexlDynamicConverter, LocaleConverter, LongConverter, MVELDynamicConverter, OgnlDynamicConverter, ResourcePropertyJsonValueConverter, ResourcePropertyValueConverter, ShortConverter, SqlDateConverter, SqlTimeConverter, SqlTimestampConverter, StringBufferConverter, StringBuilderConverter, StringConverter, URIConverter, URLConverter, VelocityDynamicConverter

public interface ResourcePropertyConverter
extends Converter

A specialized converter that can convert to and from strings as well. Handles ResourcePropertyMapping.

Author:
kimchy

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.
 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.
 
Methods inherited from interface org.compass.core.converter.Converter
marshall, unmarshall
 

Method Detail

fromString

Object fromString(String str,
                  ResourcePropertyMapping resourcePropertyMapping)
                  throws ConversionException
Converts from a String and into it's Object representation.

Parameters:
str - The string to convert from
resourcePropertyMapping - The resource property mapping
Returns:
Theh object converterd from the String
Throws:
ConversionException

toString

String toString(Object o,
                ResourcePropertyMapping resourcePropertyMapping)
                throws ConversionException
Converts the Object into a String.

Note that toString must be able to handle a null resourcePropertyMapping.

Parameters:
o - The Object to convert from
resourcePropertyMapping - The resource proeprty mapping
Returns:
The String converted from the Object
Throws:
ConversionException

canNormalize

boolean canNormalize()
Returns true if this converter should be used to convert query parser related values. Conversion is done by calling fromString(String, org.compass.core.mapping.ResourcePropertyMapping) and then toString(Object, org.compass.core.mapping.ResourcePropertyMapping).


suggestIndex

Property.Index suggestIndex()
The converter can suggest what type of index will be used in case no index is configured. Can return null and will let global Compass defaults to be used.


suggestTermVector

Property.TermVector suggestTermVector()
The converter can suggest if term vectors should be saved for this type in case no explicit one is configured. Can return null and will let global Compass defaults to be used.


suggestStore

Property.Store suggestStore()
The converter can suggest the store type for this type in case no explicit one is configured. Can return null and will let global Compass defaults to be used.


suggestOmitNorms

Boolean suggestOmitNorms()
The converter can suggest if norms should be saved for this type in case no explicit one is configured. Can return null and will let global Compass defaults to be used.


suggestOmitTf

Boolean suggestOmitTf()
The converter can suggest if tf should be saved for this type in case no explicit one is configured. Can return null and will let global Compass defaults to be used.



Copyright (c) 2004-2008 The Compass Project.