com.ebmwebsourcing.easybox.api
Interface XmlObject

All Superinterfaces:
java.lang.Comparable<XmlObjectNode>, XmlObjectNode
All Known Subinterfaces:
AnyXmlObject

public interface XmlObject
extends XmlObjectNode

An XmlObject provides a base interface on a binding on an XML structure.

XmlObject are organized as a tree structure. Every object knows its parent. Every object can have children of two sorts :

It is assumed that a third-party library is used to create the binding object itself. XmlObject can thus be seen as implementation independent wrapping around the generated POJO (the "model").

Author:
mjambert

Field Summary
static XmlObject[] EMPTY_ARRAY
           
 
Method Summary
 XmlObject duplicateXmlObject()
          Create a duplicate of this XmlContext.
<X extends XmlObject>
X
duplicateXmlObjectAs(java.lang.Class<X> targetInterfaceClass)
           
 XmlContext getXmlContext()
          Get XmlContext from which this XmlObject originated.
 XmlObjectNode[] getXmlObjectAdoptedChildren()
          Get list of all adopted child XmlObject.
 java.util.Map<javax.xml.namespace.QName,java.lang.Object> getXmlObjectAttributes()
          Get all attributes defined on this XmlObject.
 org.w3c.dom.Node getXmlObjectDOMNode()
          Get associated DOM node, if known.
 java.util.Map<java.lang.String,java.lang.String> getXmlObjectInScopeNamespaces()
          Get all namespace bindings in scope of this XmlObject.
 XmlObjectNode[] getXmlObjectNaturalChildren()
          Get list of all natural child XmlObject.
 void setXmlObjectQName(javax.xml.namespace.QName qname)
          Set qname of this XmlObject, if allowed.
 
Methods inherited from interface com.ebmwebsourcing.easybox.api.XmlObjectNode
getUserData, getXmlObjectAncestors, getXmlObjectBaseIndexes, getXmlObjectBaseRoot, getXmlObjectBaseURI, getXmlObjectBaseXPath, getXmlObjectChildren, getXmlObjectDescendants, getXmlObjectFollowing, getXmlObjectFollowingSibling, getXmlObjectFollowingSiblings, getXmlObjectIndex, getXmlObjectParent, getXmlObjectPreceding, getXmlObjectPrecedingOrAncestor, getXmlObjectPrecedingSibling, getXmlObjectPrecedingSiblings, getXmlObjectQName, getXmlObjectRoot, getXmlObjectTextContent, getXmlObjectValue, hasUserData, setUserData
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

EMPTY_ARRAY

static final XmlObject[] EMPTY_ARRAY
Method Detail

getXmlContext

XmlContext getXmlContext()
Get XmlContext from which this XmlObject originated.

Returns:
XmlContext which originated this object.

duplicateXmlObject

XmlObject duplicateXmlObject()
Create a duplicate of this XmlContext. All descendants are duplicated as well ; parent hierarchy is NOT duplicated.

Returns:
Duplicated instance of this XmlContext;

duplicateXmlObjectAs

<X extends XmlObject> X duplicateXmlObjectAs(java.lang.Class<X> targetInterfaceClass)

setXmlObjectQName

void setXmlObjectQName(javax.xml.namespace.QName qname)
Set qname of this XmlObject, if allowed.

Parameters:
qname - New qname.

getXmlObjectAttributes

java.util.Map<javax.xml.namespace.QName,java.lang.Object> getXmlObjectAttributes()
Get all attributes defined on this XmlObject.

Returns:
All attributes defined on this XmlObject, collected inside a map.

getXmlObjectNaturalChildren

XmlObjectNode[] getXmlObjectNaturalChildren()
Get list of all natural child XmlObject.

Returns:
Properly ordered list of all natural child objects.

getXmlObjectAdoptedChildren

XmlObjectNode[] getXmlObjectAdoptedChildren()
Get list of all adopted child XmlObject.

Returns:
Properly ordered list of all adopted child objects.

getXmlObjectDOMNode

org.w3c.dom.Node getXmlObjectDOMNode()
Get associated DOM node, if known.

Returns:
Associated DOM node, or null if none.

getXmlObjectInScopeNamespaces

java.util.Map<java.lang.String,java.lang.String> getXmlObjectInScopeNamespaces()
Get all namespace bindings in scope of this XmlObject.

Returns:
Map of prefix => namespace URI known on this XmlObject (ie declared either on corresponding XML element, or on ancestors).


Copyright © 2011 Petals Link. All Rights Reserved.