|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.planetalia.dynject.injection.Converters
public class Converters
Provides a central repository for conversions between different classes. Conversions are applied when the output of one data step cannot be fed directly into the following, or when the output of the last data step is not directly assignable to the property
| Field Summary | |
|---|---|
static java.lang.Class |
ANY_NUMERIC_CLASS
Constant value representing "any numeric class". |
static java.lang.String |
CONVERT_STRING_TO_ENUM
Constant representing the capability of converting any string into the corresponding enumerated value |
static java.lang.String |
CONVERT_USING_STRING_CONSTRUCTOR
Constant representing the capability of converting strings into any class that has a public string constructor by creating an instance using that constructor. |
| Constructor Summary | |
|---|---|
Converters()
|
|
| Method Summary | |
|---|---|
static void |
clearConverters()
Removes all registered converters. |
static IConverter |
getConverter(java.lang.Class fromClass,
java.lang.Class toClass)
Returns the converter to use for a specific conversion |
static java.lang.Object |
getProperty(java.lang.String property)
Returns a configuration property |
static boolean |
isEquivalent(java.lang.Class classA,
java.lang.Class classB)
Checks whether two classes are assignment - equivalent |
static boolean |
isNumeric(java.lang.Class clazz)
Checks whether a specific value is numeric |
static boolean |
isNumeric(java.lang.Object value)
Checks whether a specific value is numeric |
static void |
registerConverter(java.lang.Class fromClass,
java.lang.Class toClass,
IConverter converter)
Registers a converter |
static void |
registerStandardConverters()
Used for testing purposes only |
void |
removeConverter(java.lang.Class fromClass,
java.lang.Class toClass)
Removes a converter previously registered. |
static void |
setProperty(java.lang.String property,
java.lang.Object value)
Configures the overall working of the conversion process by setting a specific feature |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String CONVERT_USING_STRING_CONSTRUCTOR
public static final java.lang.String CONVERT_STRING_TO_ENUM
public static final java.lang.Class ANY_NUMERIC_CLASS
| Constructor Detail |
|---|
public Converters()
| Method Detail |
|---|
public static void registerConverter(java.lang.Class fromClass,
java.lang.Class toClass,
IConverter converter)
fromClass - Source classtoClass - Destination classconverter - Converter instance. Converter instances are reused and must be thread-safepublic static void clearConverters()
public void removeConverter(java.lang.Class fromClass,
java.lang.Class toClass)
fromClass - Source class or interfacetoClass - Target class or interfacepublic static boolean isNumeric(java.lang.Class clazz)
clazz - Class to check
public static boolean isNumeric(java.lang.Object value)
value - Value to check
public static IConverter getConverter(java.lang.Class fromClass,
java.lang.Class toClass)
fromClass - Source classtoClass - Destination class
public static void registerStandardConverters()
public static void setProperty(java.lang.String property,
java.lang.Object value)
property - Property to setvalue - valuepublic static java.lang.Object getProperty(java.lang.String property)
property -
public static boolean isEquivalent(java.lang.Class classA,
java.lang.Class classB)
classA - First class to checkclassB - Second class to check
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||