Package net.sf.basedb.util.jep.convert
Class ConverterFactory
java.lang.Object
net.sf.basedb.util.jep.convert.ConverterFactory
Keep
JepConversionFunction
objects for converting built-in
JEP object to Query API Expression
or Restriction
objects.- Version:
- 2.4
- Author:
- nicklas
- See Also:
- Last modified
- $Date: 2008-09-11 22:08:14 +0200 (to, 11 sep 2008) $
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic JepConversionFunction<?>
Get a converter for the specified built-in JEP object.static JepConversionFunction<?>
Get a converter for the specified built-in JEP object by checking if a converter has been registered for it's class.static Collection<JepConversionFunction<?>>
Get all registered converters.static void
registerConverter
(Object o, JepConversionFunction<?> converter) Add a converter for a specific object.
-
Field Details
-
converters
-
-
Constructor Details
-
ConverterFactory
public ConverterFactory()
-
-
Method Details
-
getConverter
Get a converter for the specified built-in JEP object.- Parameters:
o
- The object to convert- Returns:
- A
JepConversionFunction
or null if no converter is found
-
getConverterByClass
Get a converter for the specified built-in JEP object by checking if a converter has been registered for it's class.- Parameters:
o
- The object to convert- Returns:
- A
JepConversionFunction
or null if no converter is found
-
registerConverter
Add a converter for a specific object. It can for example, be the class of a JEP function, the symbol for an operator:registerConverter(Add.class, new AddConverter()); registerConverter("==", new EqualsConverter());
- Parameters:
o
- The object defining what the converter can convertconverter
- The converter- Throws:
ItemAlreadyExistsException
- If a converter already exists for the given class
-
getConverters
Get all registered converters.
-