|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.binding.metadata.Converters
public class Converters
Class containing the static converter registry and a set of static Converter classes for the common Java data types:
Converter converter = Converters.get(Integer.class);
try {
Integer value = (Integer)converter.decode("99", null);
}
catch (ConversionException e) {
// conversion error!
}
Converters can also be added or replaced in the registry:
Converters.put(Foo.class, new FooConverter());
Nested Class Summary | |
---|---|
static class |
Converters.DateConverter
Converter for java.util.Date. |
Constructor Summary | |
---|---|
protected |
Converters()
|
Method Summary | |
---|---|
static Converter |
get(java.lang.Class klass)
Retrieves the converter for the class. |
static java.lang.Class[] |
getTypes()
Return all the types which currently have supported type converters. |
static void |
put(java.lang.Class klass,
Converter converter)
Registers the specified converter for the specified class, overriding any prior converter mapping for that class if it existed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected Converters()
Method Detail |
---|
public static Converter get(java.lang.Class klass)
klass
- class used as key for converter lookup
public static void put(java.lang.Class klass, Converter converter)
klass
- class used as key for converter lookupconverter
- Converter instance to be registered for the classpublic static java.lang.Class[] getTypes()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |