|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Converter
An interface for converting types from a string to some other type.
Method Summary | |
---|---|
java.lang.Object |
convertInbound(java.lang.Class paramType,
InboundVariable data,
InboundContext inctx)
Attempt to coerce the data from a string to an Object. |
OutboundVariable |
convertOutbound(java.lang.Object data,
OutboundContext outctx)
Return a javascript string that defines the variable named varName to have the contents of the converted object data. |
void |
setConverterManager(ConverterManager config)
If we are a compound converter that farms out part of the conversion to other converters then you farm the conversion out via a configuration. |
Method Detail |
---|
void setConverterManager(ConverterManager config)
config
- The confiuration objectjava.lang.Object convertInbound(java.lang.Class paramType, InboundVariable data, InboundContext inctx) throws MarshallException
paramType
- The type to convert todata
- The data to convertinctx
- The map of data that we are working on
MarshallException
- If the conversion failed for some reasonOutboundVariable convertOutbound(java.lang.Object data, OutboundContext outctx) throws MarshallException
In contrast to convertInbound()
failures in converting
data on the way out should not stop processing, and we should carry on
if we can. Failures are probably down to some misconfiguration so as much
information about the error as can be safely generated to console logs is
good. In other words if you need to loop in outbound conversion then it
might be a good idea to catch issues inside the loop, log, and carry on.
data
- The data to convertoutctx
- A collection of objects already converted and the results
MarshallException
- If the conversion failed for some reason
|
Copyright ? 2005 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |