|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.commons.betwixt.strategy.ObjectStringConverter
Strategy class for string <-> object conversions. Implementations of this interface are used by Betwixt to perform string <-> object conversions. This performs only the most basic conversions. Most applications will use a subclass.
It is strongly recommended that (in order to support round tripping)
that objectToString
and stringToObject
are inverse functions.
In other words, given the same flavour, context and type the applying
objectToString to the result of stringToObject should be equal to the
original input.
Constructor Summary | |
ObjectStringConverter()
|
Method Summary | |
java.lang.String |
objectToString(java.lang.Object object,
java.lang.Class type,
java.lang.String flavour,
Context context)
Converts an object to a string representation. |
java.lang.Object |
stringToObject(java.lang.String value,
java.lang.Class type,
java.lang.String flavour,
Context context)
Converts a string representation to an object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ObjectStringConverter()
Method Detail |
public java.lang.String objectToString(java.lang.Object object, java.lang.Class type, java.lang.String flavour, Context context)
object
- the object to be converted, possibly nulltype
- the property class of the object, not nullflavour
- a string allow symantic differences in formatting to be communicatedcontext
- the context, not null
public java.lang.Object stringToObject(java.lang.String value, java.lang.Class type, java.lang.String flavour, Context context)
value
- the String to be convertedtype
- the property class to be returned (if possible), not nullflavour
- a string allow symantic differences in formatting to be communicatedcontext
- the context, not null
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |