|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dsto.dfc.databeans.io.TextDefaultCodec
public class TextDefaultCodec
Generic text encoder/decoder that uses toString () to encode and the single String argument constructor to decode.
Constructor Summary | |
---|---|
TextDefaultCodec()
|
Method Summary | |
---|---|
boolean |
canEncode(XmlEncodeContext context,
Object value)
Test if this codec can encode a given object. |
Object |
decode(Class type,
String text)
Decode a text value. |
String |
encode(Object value)
Encode a value into text. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TextDefaultCodec()
Method Detail |
---|
public boolean canEncode(XmlEncodeContext context, Object value)
TextEncoder
canEncode
in interface TextEncoder
context
- The current encode context.value
- The value. May be null.
public String encode(Object value) throws IllegalArgumentException
TextEncoder
encode
in interface TextEncoder
value
- The value to encode.
IllegalArgumentException
- if the value cannot be encoded.public Object decode(Class type, String text) throws IllegalArgumentException
TextDecoder
decode
in interface TextDecoder
type
- The type of value expected.text
- The text form of the value.
IllegalArgumentException
- if the value cannot be decoded.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |