dsto.dfc.databeans.io
Class XmlDefaultDecoder

java.lang.Object
  extended by dsto.dfc.databeans.io.XmlDefaultDecoder
All Implemented Interfaces:
XmlDecoder

public class XmlDefaultDecoder
extends Object
implements XmlDecoder

Default fallback XML decoder which decodes the element forms generated by XmlDefaultEncoder.

Version:
$Revision$
Author:
mpp
See Also:
XmlDefaultEncoder

Constructor Summary
XmlDefaultDecoder()
           
 
Method Summary
 Object decode(XmlDecodeContext context, org.jdom.Element element)
          Decode an XML representation into a value.
protected  Object decodeArray(XmlDecodeContext context, org.jdom.Element element)
          Decode an array.
protected  Object decodeArrayChildren(XmlDecodeContext context, org.jdom.Element element, Class valueType)
          Decode an array encoded using nested child elements.
protected  Object decodeArrayValue(XmlDecodeContext context, org.jdom.Element element, Class valueType, String value)
          Decode an array encoded as the as a comma-delimited "value" attribute.
protected  Object decodeText(XmlDecodeContext context, org.jdom.Element element)
          Decode a text value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XmlDefaultDecoder

public XmlDefaultDecoder()
Method Detail

decode

public Object decode(XmlDecodeContext context,
                     org.jdom.Element element)
              throws IllegalArgumentException,
                     ClassNotFoundException
Description copied from interface: XmlDecoder
Decode an XML representation into a value.

Specified by:
decode in interface XmlDecoder
Parameters:
context - The decode context.
element - The element to decode.
Returns:
The new object.
Throws:
IllegalArgumentException - if an error is found in the structure of the document.
ClassNotFoundException - if a referenced class cannot be found.

decodeArray

protected Object decodeArray(XmlDecodeContext context,
                             org.jdom.Element element)
                      throws ClassNotFoundException,
                             IllegalArgumentException
Decode an array.

Throws:
ClassNotFoundException
IllegalArgumentException

decodeArrayChildren

protected Object decodeArrayChildren(XmlDecodeContext context,
                                     org.jdom.Element element,
                                     Class valueType)
                              throws ClassNotFoundException,
                                     IllegalArgumentException
Decode an array encoded using nested child elements.

Throws:
ClassNotFoundException
IllegalArgumentException

decodeArrayValue

protected Object decodeArrayValue(XmlDecodeContext context,
                                  org.jdom.Element element,
                                  Class valueType,
                                  String value)
Decode an array encoded as the as a comma-delimited "value" attribute.


decodeText

protected Object decodeText(XmlDecodeContext context,
                            org.jdom.Element element)
                     throws IllegalArgumentException,
                            ClassNotFoundException
Decode a text value.

Throws:
IllegalArgumentException
ClassNotFoundException


Copyright © 2008 Commonwealth of Australia