|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.granite.messaging.amf.io.convert.Converters
public class Converters
Converter,
Reverter| Constructor Summary | |
|---|---|
Converters(List<Class<? extends Converter>> converterClasses)
Constructs a new Converters instance with the supplied list of converters (possibly reverters). |
|
| Method Summary | |
|---|---|
Object |
convert(Object value,
Type targetType)
Converts the supplied object to the supplied target type. |
Converter |
getConverter(Object value,
Type targetType)
Returns a suitable converter for supplied parameters or null if no converter can be found. |
Converter |
getConverter(Object value,
Type targetType,
boolean throwNotFoundException)
Returns a suitable converter for supplied parameters or either returns null if no converter can be found or throws a NoConverterFoundException. |
Converter[] |
getConverters()
|
boolean |
hasReverters()
Returns true if at least one reverter is configured for this Converters instance. |
Object |
revert(Object value)
Revert back to standard, AMF3 known Java type the supplied value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Converters(List<Class<? extends Converter>> converterClasses)
throws NoSuchMethodException,
IllegalAccessException,
InvocationTargetException,
InstantiationException
converterClasses - the list of all used converters.
NoSuchMethodException - if one of the Converter does not have a constructor with a
Converters parameter.
IllegalAccessException - if something goes wrong when creating an instance of one
of the supplied Converter classes.
InvocationTargetException - if something goes wrong when creating an instance of one
of the supplied Converter classes.
InstantiationException - if something goes wrong when creating an instance of one
of the supplied Converter classes.| Method Detail |
|---|
public Converter getConverter(Object value,
Type targetType)
getConverter(Object, Type, boolean) method with the
throwNotFoundException parameter set to false.
value - the value to be convertedtargetType - the type of the converted value
public Converter getConverter(Object value,
Type targetType,
boolean throwNotFoundException)
throws NoConverterFoundException
NoConverterFoundException.
value - the value to be convertedtargetType - the type of the converted valuethrowNotFoundException - should an exception be thrown if no converter is found?
NoConverterFoundException - if the throwNotFoundException parameter is set to true
and no converter can be found.
public Object convert(Object value,
Type targetType)
throws NoConverterFoundException
value - the object to be converted.targetType - the target type.
NoConverterFoundException - if no suitable converter can be found.public boolean hasReverters()
public Object revert(Object value)
Reverter.revert(Object) method result
if the Reverter.canRevert(Object) method returns true for the current Reverter
instance.
value - the value to be reverted.
public Converter[] getConverters()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||