public class ConverterFactory
extends java.lang.Object
JepConversionFunction
objects for converting built-in
JEP object to Query API Expression
or Restriction
objects.JepConversionFunction
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.Object,JepConversionFunction<?>> |
converters |
Constructor and Description |
---|
ConverterFactory() |
Modifier and Type | Method and Description |
---|---|
static JepConversionFunction<?> |
getConverter(java.lang.Object o)
Get a converter for the specified built-in JEP object.
|
static JepConversionFunction<?> |
getConverterByClass(java.lang.Object o)
Get a converter for the specified built-in JEP object by checking if
a converter has been registered for it's class.
|
static java.util.Collection<JepConversionFunction<?>> |
getConverters()
Get all registered converters.
|
static void |
registerConverter(java.lang.Object o,
JepConversionFunction<?> converter)
Add a converter for a specific object.
|
private static java.util.Map<java.lang.Object,JepConversionFunction<?>> converters
public static JepConversionFunction<?> getConverter(java.lang.Object o)
o
- The object to convertJepConversionFunction
or null if no converter is foundpublic static JepConversionFunction<?> getConverterByClass(java.lang.Object o)
o
- The object to convertJepConversionFunction
or null if no converter is foundpublic static void registerConverter(java.lang.Object o, JepConversionFunction<?> converter)
registerConverter(Add.class, new AddConverter()); registerConverter("==", new EqualsConverter());
o
- The object defining what the converter can convertconverter
- The converterItemAlreadyExistsException
- If a converter already exists for the given classpublic static java.util.Collection<JepConversionFunction<?>> getConverters()