org.apache.axiom.om
Interface OMContainer

All Known Subinterfaces:
OMContainerEx, OMDocument, OMElement, SOAPBody, SOAPEnvelope, SOAPFault, SOAPFaultCode, SOAPFaultDetail, SOAPFaultNode, SOAPFaultReason, SOAPFaultRole, SOAPFaultSubCode, SOAPFaultText, SOAPFaultValue, SOAPHeader, SOAPHeaderBlock, SOAPMessage
All Known Implementing Classes:
DocumentImpl, ElementImpl, OMDocumentImpl, OMElementImpl, ParentNode, SOAPBodyImpl, SOAPBodyImpl, SOAPEnvelopeImpl, SOAPEnvelopeImpl, SOAPFaultCodeImpl, SOAPFaultCodeImpl, SOAPFaultDetailImpl, SOAPFaultDetailImpl, SOAPFaultImpl, SOAPFaultImpl, SOAPFaultNodeImpl, SOAPFaultNodeImpl, SOAPFaultReasonImpl, SOAPFaultReasonImpl, SOAPFaultRoleImpl, SOAPFaultRoleImpl, SOAPFaultSubCodeImpl, SOAPFaultSubCodeImpl, SOAPFaultTextImpl, SOAPFaultTextImpl, SOAPFaultValueImpl, SOAPFaultValueImpl, SOAPHeaderBlockImpl, SOAPHeaderBlockImpl, SOAPHeaderImpl, SOAPHeaderImpl, SOAPMessageImpl, SOAPMessageImpl

public interface OMContainer

Captures the operations related to containment shared by both a document and an element.

Exposes the ability to add, find, and iterate over the children of a document or element.


Method Summary
 void addChild(OMNode omNode)
          Adds the given node as the last child.
 void buildNext()
           
 java.util.Iterator getChildren()
          Returns an iterator for the children of the container.
 java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
          Returns an iterator for child nodes matching the criteria indicated by the given QName.
 OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
          Returns the first child in document order that matches the given QName criteria.
 OMNode getFirstOMChild()
          Gets the first child.
 boolean isComplete()
           
 

Method Detail

addChild

public void addChild(OMNode omNode)
Adds the given node as the last child. One must preserve the order of children, in this operation. Tip : appending the new child is preferred.

Parameters:
omNode -

getChildrenWithName

public java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
Returns an iterator for child nodes matching the criteria indicated by the given QName.

This function searches in three ways:

Example: header.getChildrenWithName( new QName(ADDRESSING_NAMESPACE, null)); will return all of the "addressing" headers.

Parameters:
elementQName - The QName specifying namespace and local name to match.
Returns:
Returns an iterator of OMElement items that match the given QName appropriately.

getFirstChildWithName

public OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
                                throws OMException
Returns the first child in document order that matches the given QName criteria.

The QName filter is applied as in the function getChildrenWithName(javax.xml.namespace.QName).

Parameters:
elementQName - The QName to use for matching.
Returns:
Returns the first element in document order that matches the elementQName criteria.
Throws:
OMException - Could indirectly trigger building of child nodes.
See Also:
getChildrenWithName(javax.xml.namespace.QName)

getChildren

public java.util.Iterator getChildren()
Returns an iterator for the children of the container.

Returns:
Returns a Iterator of children, all of which implement OMNode.
See Also:
getFirstChildWithName(javax.xml.namespace.QName), getChildrenWithName(javax.xml.namespace.QName)

getFirstOMChild

public OMNode getFirstOMChild()
Gets the first child.

Returns:
Returns the first child. May return null if the container has no children.

isComplete

public boolean isComplete()

buildNext

public void buildNext()