org.compass.core.converter
Interface ConverterLookup

All Superinterfaces:
CompassConfigurable
All Known Implementing Classes:
DefaultConverterLookup

public interface ConverterLookup
extends CompassConfigurable

Provides the ability to lookup a converter based on it's type. The type is the actual Class that should be converted by the returned Converter.

Author:
kimchy
See Also:
Converter

Method Summary
 CompassSettings getSettings()
          Return the settings that this converter was created with.
 Converter lookupConverter(Class type)
          Looks up a converter based on the Class type.
 Converter lookupConverter(String name)
          Looks up a converter based on the converter name (or class name).
 void registerConverter(String converterName, Converter converter)
          Registers a Converter under a converter name.
 void registerConverter(String converterName, Converter converter, Class registerType)
          Registers a Converter under the converter name.
 
Methods inherited from interface org.compass.core.config.CompassConfigurable
configure
 

Method Detail

lookupConverter

Converter lookupConverter(Class type)
Looks up a converter based on the Class type.

Parameters:
type - The class to look the converter for
Returns:
The converter that match for the given class type.

lookupConverter

Converter lookupConverter(String name)
Looks up a converter based on the converter name (or class name). The converter should have been registered with the converter lookup using the registerConverter(String, Converter).

Parameters:
name - The lookup name of the converter
Returns:
The converter that match for the given name.

registerConverter

void registerConverter(String converterName,
                       Converter converter)
Registers a Converter under a converter name.

Parameters:
converterName - The converter name to be registered against
converter - The converter to use

registerConverter

void registerConverter(String converterName,
                       Converter converter,
                       Class registerType)
Registers a Converter under the converter name. Also associates the converter with the given type.

Parameters:
converterName - The converter name to be registered against
converter - The converter to use
registerType - The type to associate the converter with

getSettings

CompassSettings getSettings()
Return the settings that this converter was created with.



Copyright (c) 2004-2009 The Compass Project.