Class XmlObjectWrapper

  • All Implemented Interfaces:
    XMLizable

    public class XmlObjectWrapper
    extends XmlObject
    This class wraps an XMLizable and presents it as an XmlObject so that we can later convert this object to the complex type this represents.
    Author:
    georges.nguyen
    • Constructor Detail

      • XmlObjectWrapper

        public XmlObjectWrapper​(XMLizable xmlizable)
    • Method Detail

      • addField

        public XmlObject addField​(java.lang.String name,
                                  java.lang.Object value)
        Overrides:
        addField in class XmlObject
      • asTyped

        public XMLizable asTyped()
        Description copied from class: XmlObject
        Because we create complex types as subclasses of XMLizable instead of XmlObject (and we don't want to change interfaces), this method will return this as the complex type subclass of XMLizable, if this represents a complex type. If it does not, it will simply return this.
        Overrides:
        asTyped in class XmlObject
        Returns:
      • getField

        public java.lang.Object getField​(java.lang.String name)
        Overrides:
        getField in class XmlObject
      • getName

        public javax.xml.namespace.QName getName()
        Overrides:
        getName in class XmlObject
      • getXmlType

        public javax.xml.namespace.QName getXmlType()
        Overrides:
        getXmlType in class XmlObject
      • load

        public void load​(XmlInputStream in,
                         TypeMapper typeMapper)
                  throws java.io.IOException,
                         ConnectionException
        Description copied from interface: XMLizable
        load the fileds/children from the specified xml stream
        Specified by:
        load in interface XMLizable
        Overrides:
        load in class XmlObject
        Parameters:
        in - xml input stream from which the data is read
        typeMapper - type mapper to be used
        Throws:
        java.io.IOException - failed to read xml
        ConnectionException - failed to read/parser/bind xml
      • removeField

        public boolean removeField​(java.lang.String name)
        Overrides:
        removeField in class XmlObject
      • setField

        public XmlObject setField​(java.lang.String name,
                                  java.lang.Object value)
        Overrides:
        setField in class XmlObject
      • setName

        public void setName​(javax.xml.namespace.QName name)
        Overrides:
        setName in class XmlObject
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class XmlObject
      • write

        public void write​(javax.xml.namespace.QName element,
                          XmlOutputStream out,
                          TypeMapper typeMapper)
                   throws java.io.IOException
        Description copied from interface: XMLizable
        write this instace as xml.
        Specified by:
        write in interface XMLizable
        Overrides:
        write in class XmlObject
        Parameters:
        element - xml element name
        out - xml output stream
        typeMapper - type mapper to be used
        Throws:
        java.io.IOException - failed to write xml