Class XmlObject

  • All Implemented Interfaces:
    XMLizable
    Direct Known Subclasses:
    XmlObjectWrapper

    public class XmlObject
    extends Object
    implements XMLizable
    This is a generic XML element -- same a DOM element. In the common case this class must be able to hold child elements. We do not have a usecase for it yet. So child elements are not implemented.
    Since:
    1.0 Dec 12, 2005
    Version:
    1.0
    Author:
    http://cheenath.com
    • Constructor Detail

      • XmlObject

        public XmlObject()
      • XmlObject

        public XmlObject​(QName name)
      • XmlObject

        public XmlObject​(QName name,
                         Object value)
    • Method Detail

      • getName

        public QName getName()
      • setName

        public void setName​(QName name)
      • setDefaultNamespace

        public void setDefaultNamespace​(String namespace)
      • getXmlType

        public QName getXmlType()
      • getValue

        public Object getValue()
      • setValue

        public void setValue​(Object value)
      • hasChildren

        public boolean hasChildren()
      • asTyped

        public XMLizable asTyped()
        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.
        Returns:
      • evaluate

        public Iterator<XmlObject> evaluate​(String xpath)
        evaluate the given xpath like expression. eg xpath: "OpportunityContactRoles/records/Contact/LastName" this will list all LastName
        Parameters:
        xpath -
        Returns:
      • removeField

        public boolean removeField​(String name)
      • getTypedChildren

        public Iterator<XMLizable> getTypedChildren()
        Similar to asTyped(), this will return this object's children as the proper complex type subclass of XMLizable, if they are complex types. If a child is not a complex type, it will be returned as-is, as an XmlObject.
        Returns:
      • cloneFrom

        protected void cloneFrom​(XmlObject source)