dsto.dfc.databeans.io
Interface XmlEncoder

All Known Implementing Classes:
DefaultSWTXmlCodec, XmlAliasCodec, XmlAwtCodec, XmlCollectionsCodec, XmlDataObjectCodec, XmlDateCodec, XmlDefaultEncoder, XmlEntityCodec, XmlEnumerationCodec, XmlLinkCodec, XmlMemberwiseCodec, XmlPropertyPathCodec, XmlSingletonCodec, XmlURICodec

public interface XmlEncoder

An encoder that can generate an XML representation of an object.

Version:
$Revision$
Author:
mpp

Method Summary
 boolean canEncode(XmlEncodeContext context, Object value)
          Test if this codec can encode a given object.
 org.jdom.Element encode(XmlEncodeContext context, Object value)
          Generate an XML representation of an object.
 boolean shouldPreserveIdentity(XmlEncodeContext context, Object value)
          Return true if the identity of the given value should be preserved.
 

Method Detail

shouldPreserveIdentity

boolean shouldPreserveIdentity(XmlEncodeContext context,
                               Object value)
Return true if the identity of the given value should be preserved. If true, any instances of the object after the first will be written out as references to the original rather than a copy.


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

org.jdom.Element encode(XmlEncodeContext context,
                        Object value)
Generate an XML representation of an object.

Parameters:
context - The encoding context.
value - The value to be encoded.
Returns:
The JDOM element created for the value.


Copyright © 2008 Commonwealth of Australia