org.compass.core.converter
Interface ResourcePropertyConverter

All Superinterfaces:
Converter
All Known Subinterfaces:
FormatConverter
All Known Implementing Classes:
AbstractBasicConverter, AbstractDynamicConverter, AbstractFormatConverter, AbstractNumberConverter, BigDecimalConverter, BigIntegerConverter, BooleanConverter, ByteConverter, CalendarConverter, CharConverter, DateConverter, DoubleConverter, EnumConverter, FileConverter, FloatConverter, GroovyDynamicConverter, IntConverter, JakartaElDynamicConverter, JexlDynamicConverter, LocaleConverter, LongConverter, MetaDataFormatDelegateConverter, OgnlDynamicConverter, 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.
 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).



Copyright (c) 2004-2006 The Compass Project.