org.apache.axiom.om.impl.llom
Class OMSourcedElementImpl

java.lang.Object
  extended byorg.apache.axiom.om.impl.llom.OMNodeImpl
      extended byorg.apache.axiom.om.impl.llom.OMElementImpl
          extended byorg.apache.axiom.om.impl.llom.OMSourcedElementImpl
All Implemented Interfaces:
OMConstants, OMContainer, OMContainerEx, OMElement, OMNode, OMNodeEx

public class OMSourcedElementImpl
extends OMElementImpl

Element backed by an arbitrary data source. When necessary, this element will be expanded by creating a parser from the data source.

Whenever methods are added to the base OMElementImpl class the corresponding methods must be added to this class (there's a unit test to verify that this has been done, just to make sure nothing gets accidentally broken). If the method only requires the element name and/or namespace information, the base class method can be called directly. Otherwise, the element must be expanded into a full OM tree (by calling the #forceExpand() method) before the base class method is called. This will typically involve a heavy overhead penalty, so should be avoided if possible.


Field Summary
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
attributes, firstChild, lastChild, localName, namespaces, noPrefixNamespaceCounter, ns
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
builder, done, factory, nextSibling, nodeType, parent, previousSibling
 
Fields inherited from interface org.apache.axiom.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.axiom.om.OMConstants
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DATA_HANDLER, DEFAULT_CHAR_SET_ENCODING, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI
 
Constructor Summary
OMSourcedElementImpl(java.lang.String localName, OMNamespace ns, OMFactory factory, OMDataSource source)
          Constructor.
 
Method Summary
 OMAttribute addAttribute(OMAttribute attr)
          Inserts an attribute to this element.
 OMAttribute addAttribute(java.lang.String attributeName, java.lang.String value, OMNamespace namespace)
          Method addAttribute.
 void addChild(OMNode omNode)
          Adds child to the element.
 void buildNext()
          Forces the parser to proceed, if parser has not yet finished with the XML input.
 OMElement cloneOMElement()
          Clones this element.
 OMNamespace declareDefaultNamespace(java.lang.String uri)
          We use "" to store the default namespace of this element.
 OMNamespace declareNamespace(OMNamespace namespace)
          Declares a namespace with the element as its scope.
 OMNamespace declareNamespace(java.lang.String uri, java.lang.String prefix)
          Creates a namespace in the current element scope.
 OMNode detach()
          Removes this information item and its children, from the model completely.
 void discard()
          Method discard.
 OMNamespace findNamespace(java.lang.String uri, java.lang.String prefix)
          Finds a namespace with the given uri and prefix, in the scope of the document.
 OMNamespace findNamespaceURI(java.lang.String prefix)
          Checks for a namespace in the context of this element with the given prefix and returns the relevant namespace object, if available.
 java.util.Iterator getAllAttributes()
          Returns a List of OMAttributes.
 java.util.Iterator getAllDeclaredNamespaces()
          Method getAllDeclaredNamespaces.
 OMAttribute getAttribute(javax.xml.namespace.QName qname)
          Returns a named attribute if present.
 java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
          Returns a named attribute's value, if present.
 OMXMLParserWrapper getBuilder()
          Method getBuilder.
 java.util.Iterator getChildElements()
          Returns a filtered list of children - just the elements.
 java.util.Iterator getChildren()
          Returns a collection of this element.
 java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
          Searches for children with a given QName and returns an iterator to traverse through the OMNodes.
 OMNamespace getDefaultNamespace()
          This will retrieve the default namespace of this element, if available. null returned if none is found.
 OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
          Method getFirstChildWithName.
 OMElement getFirstElement()
          Gets first element.
 OMNode getFirstOMChild()
          Method getFirstOMChild.
 int getLineNumber()
           
 java.lang.String getLocalName()
          Method getLocalName.
 OMNamespace getNamespace()
          Method getNamespace.
 OMNode getNextOMSibling()
          Gets the next sibling.
 javax.xml.namespace.QName getQName()
          Method getQName.
 java.lang.String getText()
          Selects all the text children and concatinates them to a single string.
 javax.xml.namespace.QName getTextAsQName()
          OMText can contain its information as a QName as well.
 java.lang.String getTrimmedText()
          Returns the concatination string of TRIMMED values of all OMText child nodes of this element.
 int getType()
          Gets the type of node, as this is the super class of all the nodes.
 javax.xml.stream.XMLStreamReader getXMLStreamReader()
          Method getXMLStreamReader.
 javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
          Method getXMLStreamReaderWithoutCaching.
 void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
          Method internalSerialize.
protected  void internalSerialize(javax.xml.stream.XMLStreamWriter writer, boolean cache)
           
 void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
          This method serializes and consumes without building the object structure in memory.
 boolean isComplete()
          Method isComplete.
 boolean isExpanded()
          Check if element has been expanded into tree.
 void removeAttribute(OMAttribute attr)
          Method removeAttribute.
 javax.xml.namespace.QName resolveQName(java.lang.String qname)
          Converts a prefix:local qname string into a proper QName, evaluating it in the OMElement context.
 void serialize(java.io.OutputStream output)
          Serializes the node with caching.
 void serialize(java.io.OutputStream output, OMOutputFormat format)
          Serializes the node with caching.
 void serialize(java.io.Writer writer)
          Serializes the node with caching.
 void serialize(java.io.Writer writer, OMOutputFormat format)
          Serializes the node with caching.
 void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
          Serializes the node with caching.
 void serializeAndConsume(java.io.OutputStream output)
          Serializes the node without caching.
 void serializeAndConsume(java.io.OutputStream output, OMOutputFormat format)
          Serializes the node without caching.
 void serializeAndConsume(java.io.Writer writer)
          Serializes the node without caching.
 void serializeAndConsume(java.io.Writer writer, OMOutputFormat format)
          Serializes the node without caching.
 void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
          Serializes the node without caching.
 void setBuilder(OMXMLParserWrapper wrapper)
          Method setBuilder.
 void setFirstChild(OMNode node)
          Method setFirstChild.
 void setLineNumber(int lineNumber)
           
 void setLocalName(java.lang.String localName)
          Method setLocalName.
 void setNamespace(OMNamespace namespace)
          Method setNamespace.
 void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
          This will not search the namespace in the scope nor will declare in the current element, as in setNamespace(OMNamespace).
 void setText(javax.xml.namespace.QName text)
          Sets the text, as a QName, of the given element.
 void setText(java.lang.String text)
          Sets the text of the given element.
 java.lang.String toString()
          This is a convenience method only.
 java.lang.String toStringWithConsume()
          This is a convenience method only.
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
build, getOMFactory, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, setComplete, setNextOMSibling, setParent, setPreviousOMSibling, setType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.axiom.om.OMNode
build, getOMFactory, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore
 
Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx
setComplete
 

Constructor Detail

OMSourcedElementImpl

public OMSourcedElementImpl(java.lang.String localName,
                            OMNamespace ns,
                            OMFactory factory,
                            OMDataSource source)
Constructor.

Parameters:
localName -
ns -
factory -
source -
Method Detail

isExpanded

public boolean isExpanded()
Check if element has been expanded into tree.

Returns:
true if expanded, false if not

getChildElements

public java.util.Iterator getChildElements()
Description copied from class: OMElementImpl
Returns a filtered list of children - just the elements.

Specified by:
getChildElements in interface OMElement
Overrides:
getChildElements in class OMElementImpl
Returns:
Returns an iterator of the child elements.

declareNamespace

public OMNamespace declareNamespace(java.lang.String uri,
                                    java.lang.String prefix)
Description copied from class: OMElementImpl
Creates a namespace in the current element scope.

Specified by:
declareNamespace in interface OMElement
Overrides:
declareNamespace in class OMElementImpl
Returns:
Returns namespace.

declareDefaultNamespace

public OMNamespace declareDefaultNamespace(java.lang.String uri)
Description copied from class: OMElementImpl
We use "" to store the default namespace of this element. As one can see user can not give "" as the prefix, when he declare a usual namespace.

Specified by:
declareDefaultNamespace in interface OMElement
Overrides:
declareDefaultNamespace in class OMElementImpl
Parameters:
uri -

getDefaultNamespace

public OMNamespace getDefaultNamespace()
Description copied from interface: OMElement
This will retrieve the default namespace of this element, if available. null returned if none is found.

Specified by:
getDefaultNamespace in interface OMElement
Overrides:
getDefaultNamespace in class OMElementImpl

declareNamespace

public OMNamespace declareNamespace(OMNamespace namespace)
Description copied from interface: OMElement
Declares a namespace with the element as its scope.

Specified by:
declareNamespace in interface OMElement
Overrides:
declareNamespace in class OMElementImpl
Returns:
Returns namespace.

findNamespace

public OMNamespace findNamespace(java.lang.String uri,
                                 java.lang.String prefix)
Description copied from class: OMElementImpl
Finds a namespace with the given uri and prefix, in the scope of the document. Starts to find from the current element and goes up in the hiararchy until one is found. If none is found, returns null.

Specified by:
findNamespace in interface OMElement
Overrides:
findNamespace in class OMElementImpl

findNamespaceURI

public OMNamespace findNamespaceURI(java.lang.String prefix)
Description copied from interface: OMElement
Checks for a namespace in the context of this element with the given prefix and returns the relevant namespace object, if available. If not available, returns null.

Specified by:
findNamespaceURI in interface OMElement
Overrides:
findNamespaceURI in class OMElementImpl

getAllDeclaredNamespaces

public java.util.Iterator getAllDeclaredNamespaces()
                                            throws OMException
Description copied from class: OMElementImpl
Method getAllDeclaredNamespaces.

Specified by:
getAllDeclaredNamespaces in interface OMElement
Overrides:
getAllDeclaredNamespaces in class OMElementImpl
Returns:
Returns Iterator.
Throws:
OMException

getAllAttributes

public java.util.Iterator getAllAttributes()
Description copied from class: OMElementImpl
Returns a List of OMAttributes.

Specified by:
getAllAttributes in interface OMElement
Overrides:
getAllAttributes in class OMElementImpl
Returns:
Returns iterator.

getAttribute

public OMAttribute getAttribute(javax.xml.namespace.QName qname)
Description copied from class: OMElementImpl
Returns a named attribute if present.

Specified by:
getAttribute in interface OMElement
Overrides:
getAttribute in class OMElementImpl
Parameters:
qname - the qualified name to search for
Returns:
Returns an OMAttribute with the given name if found, or null

getAttributeValue

public java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
Description copied from class: OMElementImpl
Returns a named attribute's value, if present.

Specified by:
getAttributeValue in interface OMElement
Overrides:
getAttributeValue in class OMElementImpl
Parameters:
qname - the qualified name to search for
Returns:
Returns a String containing the attribute value, or null.

addAttribute

public OMAttribute addAttribute(OMAttribute attr)
Description copied from class: OMElementImpl
Inserts an attribute to this element. Implementor can decide as to insert this in the front or at the end of set of attributes.

Specified by:
addAttribute in interface OMElement
Overrides:
addAttribute in class OMElementImpl
Returns:
Returns attribute.

addAttribute

public OMAttribute addAttribute(java.lang.String attributeName,
                                java.lang.String value,
                                OMNamespace namespace)
Description copied from class: OMElementImpl
Method addAttribute.

Specified by:
addAttribute in interface OMElement
Overrides:
addAttribute in class OMElementImpl
Returns:
Returns OMAttribute.

removeAttribute

public void removeAttribute(OMAttribute attr)
Description copied from class: OMElementImpl
Method removeAttribute.

Specified by:
removeAttribute in interface OMElement
Overrides:
removeAttribute in class OMElementImpl

setBuilder

public void setBuilder(OMXMLParserWrapper wrapper)
Description copied from class: OMElementImpl
Method setBuilder.

Specified by:
setBuilder in interface OMElement
Overrides:
setBuilder in class OMElementImpl

getBuilder

public OMXMLParserWrapper getBuilder()
Description copied from class: OMElementImpl
Method getBuilder.

Specified by:
getBuilder in interface OMElement
Overrides:
getBuilder in class OMElementImpl
Returns:
Returns OMXMLParserWrapper.

setFirstChild

public void setFirstChild(OMNode node)
Description copied from class: OMElementImpl
Method setFirstChild.

Specified by:
setFirstChild in interface OMElement
Overrides:
setFirstChild in class OMElementImpl

getFirstElement

public OMElement getFirstElement()
Description copied from class: OMElementImpl
Gets first element.

Specified by:
getFirstElement in interface OMElement
Overrides:
getFirstElement in class OMElementImpl
Returns:
Returns element.

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader()
Description copied from class: OMElementImpl
Method getXMLStreamReader.

Specified by:
getXMLStreamReader in interface OMElement
Overrides:
getXMLStreamReader in class OMElementImpl
See Also:
OMElement.getXMLStreamReader()

getXMLStreamReaderWithoutCaching

public javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
Description copied from class: OMElementImpl
Method getXMLStreamReaderWithoutCaching.

Specified by:
getXMLStreamReaderWithoutCaching in interface OMElement
Overrides:
getXMLStreamReaderWithoutCaching in class OMElementImpl
See Also:
OMElement.getXMLStreamReaderWithoutCaching()

setText

public void setText(java.lang.String text)
Description copied from class: OMElementImpl
Sets the text of the given element. caution - This method will wipe out all the text elements (and hence any mixed content) before setting the text.

Specified by:
setText in interface OMElement
Overrides:
setText in class OMElementImpl

setText

public void setText(javax.xml.namespace.QName text)
Description copied from class: OMElementImpl
Sets the text, as a QName, of the given element. caution - This method will wipe out all the text elements (and hence any mixed content) before setting the text.

Specified by:
setText in interface OMElement
Overrides:
setText in class OMElementImpl

getText

public java.lang.String getText()
Description copied from class: OMElementImpl
Selects all the text children and concatinates them to a single string.

Specified by:
getText in interface OMElement
Overrides:
getText in class OMElementImpl
Returns:
Returns String.

getTextAsQName

public javax.xml.namespace.QName getTextAsQName()
Description copied from interface: OMElement
OMText can contain its information as a QName as well. This will return the text as a QName

Specified by:
getTextAsQName in interface OMElement
Overrides:
getTextAsQName in class OMElementImpl

getLocalName

public java.lang.String getLocalName()
Description copied from class: OMElementImpl
Method getLocalName.

Specified by:
getLocalName in interface OMElement
Overrides:
getLocalName in class OMElementImpl
Returns:
Returns local name.

setLocalName

public void setLocalName(java.lang.String localName)
Description copied from class: OMElementImpl
Method setLocalName.

Specified by:
setLocalName in interface OMElement
Overrides:
setLocalName in class OMElementImpl

getNamespace

public OMNamespace getNamespace()
                         throws OMException
Description copied from class: OMElementImpl
Method getNamespace.

Specified by:
getNamespace in interface OMElement
Overrides:
getNamespace in class OMElementImpl
Throws:
OMException

setNamespace

public void setNamespace(OMNamespace namespace)
Description copied from class: OMElementImpl
Method setNamespace.

Specified by:
setNamespace in interface OMElement
Overrides:
setNamespace in class OMElementImpl

setNamespaceWithNoFindInCurrentScope

public void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
Description copied from interface: OMElement
This will not search the namespace in the scope nor will declare in the current element, as in setNamespace(OMNamespace). This will just assign the given namespace to the element.

Specified by:
setNamespaceWithNoFindInCurrentScope in interface OMElement
Overrides:
setNamespaceWithNoFindInCurrentScope in class OMElementImpl

getQName

public javax.xml.namespace.QName getQName()
Description copied from class: OMElementImpl
Method getQName.

Specified by:
getQName in interface OMElement
Overrides:
getQName in class OMElementImpl
Returns:
Returns QName.

toStringWithConsume

public java.lang.String toStringWithConsume()
                                     throws javax.xml.stream.XMLStreamException
Description copied from interface: OMElement
This is a convenience method only. This basically serializes the given OMElement to a String but will NOT build the OMTree in the memory. So you are at your own risk of losing information.

Specified by:
toStringWithConsume in interface OMElement
Overrides:
toStringWithConsume in class OMElementImpl
Throws:
javax.xml.stream.XMLStreamException

resolveQName

public javax.xml.namespace.QName resolveQName(java.lang.String qname)
Description copied from class: OMElementImpl
Converts a prefix:local qname string into a proper QName, evaluating it in the OMElement context. Unprefixed qnames resolve to the local namespace.

Specified by:
resolveQName in interface OMElement
Overrides:
resolveQName in class OMElementImpl
Parameters:
qname - prefixed qname string to resolve
Returns:
Returns null for any failure to extract a qname.

cloneOMElement

public OMElement cloneOMElement()
Description copied from interface: OMElement
Clones this element. Since both elements are build compleletely, you will lose the differed building capability.

Specified by:
cloneOMElement in interface OMElement
Overrides:
cloneOMElement in class OMElementImpl

setLineNumber

public void setLineNumber(int lineNumber)
Specified by:
setLineNumber in interface OMElement
Overrides:
setLineNumber in class OMElementImpl

getLineNumber

public int getLineNumber()
Specified by:
getLineNumber in interface OMElement
Overrides:
getLineNumber in class OMElementImpl

discard

public void discard()
             throws OMException
Description copied from class: OMElementImpl
Method discard.

Specified by:
discard in interface OMNode
Overrides:
discard in class OMElementImpl
Throws:
OMException

getType

public int getType()
Description copied from class: OMElementImpl
Gets the type of node, as this is the super class of all the nodes.

Specified by:
getType in interface OMNode
Overrides:
getType in class OMElementImpl

internalSerialize

public void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
                       throws javax.xml.stream.XMLStreamException
Description copied from class: OMElementImpl
Method internalSerialize.

Specified by:
internalSerialize in interface OMNodeEx
Overrides:
internalSerialize in class OMElementImpl
Throws:
javax.xml.stream.XMLStreamException

internalSerialize

protected void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
                                 boolean cache)
                          throws javax.xml.stream.XMLStreamException
Overrides:
internalSerialize in class OMElementImpl
Throws:
javax.xml.stream.XMLStreamException

internalSerializeAndConsume

public void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
                                 throws javax.xml.stream.XMLStreamException
Description copied from class: OMElementImpl
This method serializes and consumes without building the object structure in memory. Misuse of this method will cause loss of data. So it is advised to use populateYourSelf() method, before calling this method, if one wants to preserve data in the stream. This was requested during the second Axis2 summit.

Specified by:
internalSerializeAndConsume in interface OMNodeEx
Overrides:
internalSerializeAndConsume in class OMElementImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
               throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node with caching.

Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMNodeImpl
Parameters:
xmlWriter -
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.OutputStream output)
               throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node with caching.

Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.Writer writer)
               throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node with caching.

Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.OutputStream output,
                      OMOutputFormat format)
               throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node with caching.

Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.Writer writer,
                      OMOutputFormat format)
               throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node with caching.

Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
                         throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node without caching.

Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMNodeImpl
Parameters:
xmlWriter -
Throws:
javax.xml.stream.XMLStreamException
See Also:
#internalSerializeAndConsume(org.apache.axiom.om.impl.MTOMXMLStreamWriter)

serializeAndConsume

public void serializeAndConsume(java.io.OutputStream output)
                         throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node without caching.

Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(java.io.Writer writer)
                         throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node without caching.

Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(java.io.OutputStream output,
                                OMOutputFormat format)
                         throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node without caching.

Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(java.io.Writer writer,
                                OMOutputFormat format)
                         throws javax.xml.stream.XMLStreamException
Description copied from interface: OMNode
Serializes the node without caching.

Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMNodeImpl
Throws:
javax.xml.stream.XMLStreamException

addChild

public void addChild(OMNode omNode)
Description copied from class: OMElementImpl
Adds child to the element. One can decide whether to append the child or to add to the front of the children list.

Specified by:
addChild in interface OMContainer
Overrides:
addChild in class OMElementImpl

getChildrenWithName

public java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
Description copied from class: OMElementImpl
Searches for children with a given QName and returns an iterator to traverse through the OMNodes. This QName can contain any combination of prefix, localname and URI.

Specified by:
getChildrenWithName in interface OMContainer
Overrides:
getChildrenWithName in class OMElementImpl

getFirstChildWithName

public OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
                                throws OMException
Description copied from class: OMElementImpl
Method getFirstChildWithName.

Specified by:
getFirstChildWithName in interface OMContainer
Overrides:
getFirstChildWithName in class OMElementImpl
Throws:
OMException

getChildren

public java.util.Iterator getChildren()
Description copied from class: OMElementImpl
Returns a collection of this element. Children can be of types OMElement, OMText.

Specified by:
getChildren in interface OMContainer
Overrides:
getChildren in class OMElementImpl
Returns:
Returns children.

getFirstOMChild

public OMNode getFirstOMChild()
Description copied from class: OMElementImpl
Method getFirstOMChild.

Specified by:
getFirstOMChild in interface OMContainer
Overrides:
getFirstOMChild in class OMElementImpl
Returns:
Returns child.

buildNext

public void buildNext()
Description copied from class: OMElementImpl
Forces the parser to proceed, if parser has not yet finished with the XML input.

Specified by:
buildNext in interface OMContainer
Overrides:
buildNext in class OMElementImpl

detach

public OMNode detach()
              throws OMException
Description copied from class: OMElementImpl
Removes this information item and its children, from the model completely.

Specified by:
detach in interface OMNode
Overrides:
detach in class OMElementImpl
Throws:
OMException

getNextOMSibling

public OMNode getNextOMSibling()
                        throws OMException
Description copied from class: OMElementImpl
Gets the next sibling. This can be an OMAttribute or OMText or OMELement for others.

Specified by:
getNextOMSibling in interface OMNode
Overrides:
getNextOMSibling in class OMElementImpl
Throws:
OMException

getTrimmedText

public java.lang.String getTrimmedText()
Description copied from class: OMElementImpl
Returns the concatination string of TRIMMED values of all OMText child nodes of this element. This is included purely to improve usability.

Overrides:
getTrimmedText in class OMElementImpl

isComplete

public boolean isComplete()
Description copied from class: OMElementImpl
Method isComplete.

Specified by:
isComplete in interface OMNode
Overrides:
isComplete in class OMElementImpl
Returns:
Returns boolean.

toString

public java.lang.String toString()
Description copied from interface: OMElement
This is a convenience method only. This will basically serialize the given OMElement to a String but will build the OMTree in the memory

Specified by:
toString in interface OMElement
Overrides:
toString in class OMElementImpl