|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.convert1.ConvertRegistry
public class ConvertRegistry
Stores Converters under a dual-key system of fromClass to toClass.
Constructor Summary | |
---|---|
ConvertRegistry()
|
Method Summary | |
---|---|
void |
clear()
Remove all registered Converter s. |
Object |
convert(Object value,
Class toClass)
Convert the specified value to an object of the specified class (if possible). |
void |
deregister(Class fromClass,
Class toClass)
Remove any registered Converter for the specified destination
Class . |
void |
fromClassDeregister(Class fromClass)
|
Converter |
lookup(Class fromClass,
Class toClass)
Look up and return any registered Converter for the specified
destination class; if there is no registered Converter, return
null . |
void |
register(Converter converter,
Class fromClass,
Class toClass)
Register a custom Converter for the specified destination
Class , replacing any previously registered Converter. |
void |
toClassDeregister(Class toClass)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ConvertRegistry()
Method Detail |
---|
public Object convert(Object value, Class toClass)
value
- Value to be converted (may be null)clazz
- Java class to be converted to
ConversionException
- if thrown by an underlying Converterpublic void clear()
Converter
s.
public void deregister(Class fromClass, Class toClass)
Converter
for the specified destination
Class
.
clazz
- Class for which to remove a registered Converterpublic void fromClassDeregister(Class fromClass)
public void toClassDeregister(Class toClass)
public Converter lookup(Class fromClass, Class toClass)
Converter
for the specified
destination class; if there is no registered Converter, return
null
.
clazz
- Class for which to return a registered Converterpublic void register(Converter converter, Class fromClass, Class toClass)
Converter
for the specified destination
Class
, replacing any previously registered Converter.
converter
- Converter to be registeredclazz
- Destination class for conversions performed by this
Converter
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |