|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--org.codehaus.spice.converter.AbstractConverter
Instances of this interface are used to convert between different types.
| Constructor Summary | |
protected |
AbstractConverter(Class source,
Class destination)
Constructor for a converter between types source and destination |
protected |
AbstractConverter(Class source,
Class destination,
Object defaultValue)
Constructor for a converter between types source and destination with a default value. |
| Method Summary | |
Object |
convert(Class destination,
Object original,
Object context)
Convert an object from original to destination types |
protected abstract Object |
convert(Object original,
Object context)
Overide this in a particular converter to do the conversion. |
protected Object |
noConvert(Object value,
Throwable throwable)
A helper method to throw an exception indicating that could not perform conversion of specified object due to an exception. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected AbstractConverter(Class source,
Class destination)
source - the source typedestination - the destination type
protected AbstractConverter(Class source,
Class destination,
Object defaultValue)
source - the source typedestination - the destination typedefaultValue - the default value| Method Detail |
public Object convert(Class destination,
Object original,
Object context)
throws ConverterException
convert in interface Converterdestination - the destination typeoriginal - the original Objectcontext - the context in which to convert
ConverterException - if an error occurs
protected final Object noConvert(Object value,
Throwable throwable)
throws ConverterException
ConverterException
protected abstract Object convert(Object original,
Object context)
throws ConverterException
original - the original Objectcontext - the context in which to convert
ConverterException - if an error occurs
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||