org.compass.core.converter.extended
Class LocaleConverter

java.lang.Object
  extended by org.compass.core.converter.basic.AbstractBasicConverter
      extended by org.compass.core.converter.extended.LocaleConverter
All Implemented Interfaces:
Converter, ResourcePropertyConverter

public class LocaleConverter
extends AbstractBasicConverter

Converts a Locale to and from a Search Engine Property. Forces the index to always be UN_TOKENIZED.

Author:
kimchy

Constructor Summary
LocaleConverter()
           
 
Method Summary
protected  Property createProperty(String value, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
          Creates a new property to be added to the resource during the marshalling process.
protected  Object doFromString(String str, ResourcePropertyMapping resourcePropertyMapping, MarshallingContext context)
          Override the from String in order to un-marshall the String back into its object representation.
 
Methods inherited from class org.compass.core.converter.basic.AbstractBasicConverter
canNormalize, doSetBoost, doToString, fromString, fromString, getNullValue, handleNulls, isNullValue, marshall, suggestIndex, suggestOmitNorms, suggestStore, suggestTermVector, toString, toString, unmarshall
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocaleConverter

public LocaleConverter()
Method Detail

doFromString

protected Object doFromString(String str,
                              ResourcePropertyMapping resourcePropertyMapping,
                              MarshallingContext context)
                       throws ConversionException
Description copied from class: AbstractBasicConverter
Override the from String in order to un-marshall the String back into its object representation.

Specified by:
doFromString in class AbstractBasicConverter
Throws:
ConversionException

createProperty

protected Property createProperty(String value,
                                  ResourcePropertyMapping resourcePropertyMapping,
                                  MarshallingContext context)
Description copied from class: AbstractBasicConverter
Creates a new property to be added to the resource during the marshalling process. Allows sub classes to override ti in order to modify the created property.

Overrides:
createProperty in class AbstractBasicConverter
Parameters:
value - The value of the property
resourcePropertyMapping - The resource mapping definition of the property
context - The context (allows to get the search engine from it)
Returns:
The property to be added to the Resource


Copyright (c) 2004-2008 The Compass Project.