|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cubeengine.converter.ConverterManager
public class ConverterManager
This Class manages all Converter for a CodecManager or a Codec
| Constructor Summary | |
|---|---|
protected |
ConverterManager(ConverterManager fallbackManager)
|
| Method Summary | ||
|---|---|---|
|
convertFromNode(Node node,
Type type)
Converts a Node into an Object of given Type |
|
|
convertToNode(T object)
Converts a convertible Object into a Node |
|
static ConverterManager |
defaultManager()
Returns a ConverterManager with the default converters |
|
protected Object |
fromNode(Node node,
Type type)
When no converter was found directly this method is called in order to try to convert the object anyways. |
|
|
getConverterByClass(Class<ConverterT> clazz)
Returns the converter of given class |
|
Converter |
matchConverter(Class clazz)
Matches a registered Converter |
|
ConverterManager |
registerConverter(Converter converter,
Class... classes)
Registers a Converter for given Class |
|
ConverterManager |
removeConverter(Class clazz)
Removes a Converter from this manager |
|
ConverterManager |
removeConverters()
Removes all registered converters |
|
ConverterManager |
subManager()
Returns a new ConverterManager using this manager as fallback |
|
protected
|
toNode(T object)
When no converter was found directly this method is called in order to try to convert the object anyways. |
|
ConverterManager |
withFallback(ConverterManager defaultManager)
Changes the fallback ConverterManager of this converter |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected ConverterManager(ConverterManager fallbackManager)
| Method Detail |
|---|
public static ConverterManager defaultManager()
public final ConverterManager subManager()
public final ConverterManager registerConverter(Converter converter,
Class... classes)
converter - the converterclasses - the classpublic final ConverterManager removeConverter(Class clazz)
clazz - the class of the converter to removepublic final ConverterManager removeConverters()
public final Converter matchConverter(Class clazz)
throws ConverterNotFoundException
clazz - the class to match for
ConverterNotFoundException
public final <T> Node convertToNode(T object)
throws ConversionException
object - the Object
ConversionException
protected <T> Node toNode(T object)
throws ConversionException
object - the object to convert
ConversionException
public final <T> T convertFromNode(Node node,
Type type)
throws ConversionException
node - the nodetype - the type of the object
ConversionException
protected Object fromNode(Node node,
Type type)
throws ConversionException
node - the node to converttype - the type to convert to
ConversionExceptionpublic ConverterManager withFallback(ConverterManager defaultManager)
defaultManager - the ConverterManager to fallback to
public final <ConverterT> ConverterT getConverterByClass(Class<ConverterT> clazz)
ConverterT - the converter Typeclazz - the class
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||