dsto.dfc.databeans.io
Interface TextEncoder

All Known Implementing Classes:
TextDefaultCodec

public interface TextEncoder

An object that can encode another object into text form.

Version:
$Revision$
Author:
mpp

Method Summary
 boolean canEncode(XmlEncodeContext context, Object value)
          Test if this codec can encode a given object.
 String encode(Object value)
          Encode a value into text.
 

Method Detail

canEncode

boolean canEncode(XmlEncodeContext context,
                  Object value)
Test if this codec can encode a given object.

Parameters:
context - The current encode context.
value - The value. May be null.
Returns:
True if this encoder should be used for value.

encode

String encode(Object value)
              throws IllegalArgumentException
Encode a value into text.

Parameters:
value - The value to encode.
Returns:
String The encoded value.
Throws:
IllegalArgumentException - if the value cannot be encoded.


Copyright © 2008 Commonwealth of Australia