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

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMSerializableImpl
      extended by org.apache.axiom.om.impl.llom.OMNodeImpl
          extended by org.apache.axiom.om.impl.llom.OMElementImpl
              extended by org.apache.axiom.om.impl.llom.OMSourcedElementImpl
All Implemented Interfaces:
IChildNode, IContainer, IElement, IParentNode, OMContainerEx, OMElementEx, OMNodeEx, OMConstants, OMContainer, OMElement, OMInformationItem, OMNamedInformationItem, OMNode, OMSerializable, OMSourcedElement
Direct Known Subclasses:
SOAPHeaderBlockImpl

public class OMSourcedElementImpl
extends OMElementImpl
implements OMSourcedElement

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, builder, firstChild, lastChild, localName, namespaces, ns, qName, state
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
nextSibling, parent, previousSibling
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
factory
 
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.impl.common.IParentNode
COMPLETE, DISCARDED, INCOMPLETE
 
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_DEFAULT_NAMESPACE, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLATTRTYPE_CDATA, XMLATTRTYPE_ENTITIES, XMLATTRTYPE_ENTITY, XMLATTRTYPE_ID, XMLATTRTYPE_IDREF, XMLATTRTYPE_IDREFS, XMLATTRTYPE_NMTOKEN, XMLATTRTYPE_NMTOKENS, XMLATTRTYPE_NOTATION, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI
 
Constructor Summary
OMSourcedElementImpl(OMContainer parent, java.lang.String localName, OMNamespace ns, OMXMLParserWrapper builder, OMFactory factory, boolean generateNSDecl)
           
OMSourcedElementImpl(OMFactory factory, OMDataSource source)
           
OMSourcedElementImpl(javax.xml.namespace.QName qName, OMFactory factory, OMDataSource source)
          Constructor that takes a QName instead of the local name and the namespace seperately
OMSourcedElementImpl(java.lang.String localName, OMNamespace ns, OMContainer parent, OMFactory factory)
           
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)
           
 void addChild(OMNode omNode)
           
 void addChild(OMNode omNode, boolean fromBuilder)
           
 OMNamespace addNamespaceDeclaration(java.lang.String uri, java.lang.String prefix)
           
 void build()
           
 void buildWithAttachments()
          Parses this node and builds the object structure in memory.
 OMInformationItem clone(OMCloneOptions options)
           
 OMElement cloneOMElement()
           
protected  OMElement createClone(OMCloneOptions options, OMContainer targetParent)
           
protected  OMSourcedElement createClone(OMCloneOptions options, OMDataSource ds)
           
 OMNamespace declareDefaultNamespace(java.lang.String uri)
           
 OMNamespace declareNamespace(OMNamespace namespace)
           
 OMNamespace declareNamespace(java.lang.String uri, java.lang.String prefix)
           
 OMNode detach()
          Removes this information item and its children, from the model completely.
 void discard()
          Method discard.
 void discarded()
           
 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)
           
 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 getChildrenWithLocalName(java.lang.String localName)
           
 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.
 java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)
           
 OMDataSource getDataSource()
          Provide access to the data source encapsulated in OMSourcedElement.
 OMNamespace getDefaultNamespace()
           
 java.util.Iterator getDescendants(boolean includeSelf)
           
 OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
          Method getFirstChildWithName.
 OMElement getFirstElement()
          Gets first element.
 OMNode getFirstOMChild()
          Method getFirstOMChild.
 OMNode getFirstOMChildIfAvailable()
           
 OMNode getLastKnownOMChild()
           
 int getLineNumber()
           
 java.lang.String getLocalName()
          Method getLocalName.
 OMNamespace getNamespace()
           
 javax.xml.namespace.NamespaceContext getNamespaceContext(boolean detached)
           
 java.util.Iterator getNamespacesInScope()
           
 java.lang.String getNamespaceURI()
           
 OMNode getNextOMSibling()
          Returns the next sibling.
 OMNode getNextOMSiblingIfAvailable()
           
 java.lang.Object getObject(java.lang.Class dataSourceClass)
           
 java.lang.String getPrefix()
           
 javax.xml.namespace.QName getQName()
          Method getQName.
 javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)
           
 int getState()
           
 java.lang.String getText()
           
 javax.xml.namespace.QName getTextAsQName()
           
 java.io.Reader getTextAsStream(boolean cache)
           
 int getType()
           
 javax.xml.stream.XMLStreamReader getXMLStreamReader()
           
 javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache)
           
 javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration configuration)
           
 javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
           
 void internalSerialize(javax.xml.stream.XMLStreamWriter writer, boolean cache)
          Serializes the node.
 boolean isComplete()
           
 boolean isExpanded()
          Check if element has been expanded into tree.
 void removeAttribute(OMAttribute attr)
           
 void removeChildren()
           
 javax.xml.namespace.QName resolveQName(java.lang.String qname)
           
 void serialize(java.io.OutputStream output)
           
 void serialize(java.io.OutputStream output, OMOutputFormat format)
           
 void serialize(java.io.Writer writer)
           
 void serialize(java.io.Writer writer, OMOutputFormat format)
           
 void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
           
 void serializeAndConsume(java.io.OutputStream output)
           
 void serializeAndConsume(java.io.OutputStream output, OMOutputFormat format)
           
 void serializeAndConsume(java.io.Writer writer)
           
 void serializeAndConsume(java.io.Writer writer, OMOutputFormat format)
           
 void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
           
 void setBuilder(OMXMLParserWrapper wrapper)
          Method setBuilder.
 void setComplete(boolean value)
          setComplete override The OMSourcedElement has its own isolated builder/reader during the expansion process.
 OMDataSource setDataSource(OMDataSource dataSource)
          setOMDataSource
 void setFirstChild(OMNode node)
          Method setFirstChild.
 void setLastChild(OMNode omNode)
           
 void setLineNumber(int lineNumber)
           
 void setLocalName(java.lang.String localName)
          Method setLocalName.
 void setNamespace(OMNamespace namespace)
           
 void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
           
 void setText(javax.xml.namespace.QName text)
           
 void setText(java.lang.String text)
           
 java.lang.String toString()
           
 java.lang.String toStringWithConsume()
           
 void undeclarePrefix(java.lang.String prefix)
           
 void writeTextTo(java.io.Writer out, boolean cache)
           
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
getIParentNode, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
close, getOMFactory, serialize
 
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
getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore
 
Methods inherited from interface org.apache.axiom.om.OMSerializable
close, serialize
 
Methods inherited from interface org.apache.axiom.om.OMInformationItem
getOMFactory
 
Methods inherited from interface org.apache.axiom.om.impl.common.IChildNode
getIParentNode
 
Methods inherited from interface org.apache.axiom.om.impl.OMNodeEx
internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling
 

Constructor Detail

OMSourcedElementImpl

public OMSourcedElementImpl(OMFactory factory,
                            OMDataSource source)

OMSourcedElementImpl

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

Parameters:
localName -
ns -
factory -
source -

OMSourcedElementImpl

public OMSourcedElementImpl(javax.xml.namespace.QName qName,
                            OMFactory factory,
                            OMDataSource source)
Constructor that takes a QName instead of the local name and the namespace seperately

Parameters:
qName -
factory -
source -

OMSourcedElementImpl

public OMSourcedElementImpl(java.lang.String localName,
                            OMNamespace ns,
                            OMContainer parent,
                            OMFactory factory)

OMSourcedElementImpl

public OMSourcedElementImpl(OMContainer parent,
                            java.lang.String localName,
                            OMNamespace ns,
                            OMXMLParserWrapper builder,
                            OMFactory factory,
                            boolean generateNSDecl)
Method Detail

isExpanded

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

Specified by:
isExpanded in interface OMSourcedElement
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)
Specified by:
declareNamespace in interface OMElement
Overrides:
declareNamespace in class OMElementImpl

declareDefaultNamespace

public OMNamespace declareDefaultNamespace(java.lang.String uri)
Specified by:
declareDefaultNamespace in interface OMElement
Overrides:
declareDefaultNamespace in class OMElementImpl

getDefaultNamespace

public OMNamespace getDefaultNamespace()
Specified by:
getDefaultNamespace in interface OMElement
Overrides:
getDefaultNamespace in class OMElementImpl

declareNamespace

public OMNamespace declareNamespace(OMNamespace namespace)
Specified by:
declareNamespace in interface OMElement
Overrides:
declareNamespace in class OMElementImpl
Returns:
Returns namespace.

addNamespaceDeclaration

public OMNamespace addNamespaceDeclaration(java.lang.String uri,
                                           java.lang.String prefix)
Specified by:
addNamespaceDeclaration in interface OMElementEx
Overrides:
addNamespaceDeclaration in class OMElementImpl

undeclarePrefix

public void undeclarePrefix(java.lang.String prefix)
Specified by:
undeclarePrefix in interface OMElement
Overrides:
undeclarePrefix in class OMElementImpl

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)
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

getNamespacesInScope

public java.util.Iterator getNamespacesInScope()
                                        throws OMException
Specified by:
getNamespacesInScope in interface OMElement
Overrides:
getNamespacesInScope in class OMElementImpl
Throws:
OMException

getNamespaceContext

public javax.xml.namespace.NamespaceContext getNamespaceContext(boolean detached)
Specified by:
getNamespaceContext in interface OMElement
Overrides:
getNamespaceContext in class OMElementImpl

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.

The owner of the attribute is set to be the particular OMElement. If the attribute already has an owner then the attribute is cloned (i.e. its name, value and namespace are copied to a new attribute) and the new attribute is added to the element. It's owner is then set to be the particular OMElement.

Specified by:
addAttribute in interface OMElement
Overrides:
addAttribute in class OMElementImpl
Returns:
The attribute that was added to the element. Note: The added attribute may not be the same instance that was given to add. This can happen if the given attribute already has an owner. In such case the returned attribute and the given attribute are equal but not the same instance.
See Also:
OMAttributeImpl.equals(Object)

addAttribute

public OMAttribute addAttribute(java.lang.String attributeName,
                                java.lang.String value,
                                OMNamespace namespace)
Specified by:
addAttribute in interface OMElement
Overrides:
addAttribute in class OMElementImpl

removeAttribute

public void removeAttribute(OMAttribute attr)
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 IParentNode
Specified by:
getBuilder in interface OMContainer
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 IContainer
Overrides:
setFirstChild in class OMElementImpl

setLastChild

public void setLastChild(OMNode omNode)
Specified by:
setLastChild in interface IContainer
Overrides:
setLastChild 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(boolean cache)
Specified by:
getXMLStreamReader in interface OMContainer
Overrides:
getXMLStreamReader in class OMElementImpl

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache,
                                                           OMXMLStreamReaderConfiguration configuration)
Specified by:
getXMLStreamReader in interface OMContainer
Overrides:
getXMLStreamReader in class OMElementImpl

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader()
Specified by:
getXMLStreamReader in interface OMContainer
Overrides:
getXMLStreamReader in class OMElementImpl

getXMLStreamReaderWithoutCaching

public javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
Specified by:
getXMLStreamReaderWithoutCaching in interface OMContainer
Overrides:
getXMLStreamReaderWithoutCaching in class OMElementImpl

setText

public void setText(java.lang.String text)
Specified by:
setText in interface OMElement
Overrides:
setText in class OMElementImpl

setText

public void setText(javax.xml.namespace.QName text)
Specified by:
setText in interface OMElement
Overrides:
setText in class OMElementImpl

getText

public java.lang.String getText()
Specified by:
getText in interface OMElement
Overrides:
getText in class OMElementImpl

getTextAsStream

public java.io.Reader getTextAsStream(boolean cache)
Specified by:
getTextAsStream in interface OMElement
Overrides:
getTextAsStream in class OMElementImpl

getTextAsQName

public javax.xml.namespace.QName getTextAsQName()
Specified by:
getTextAsQName in interface OMElement
Overrides:
getTextAsQName in class OMElementImpl

writeTextTo

public void writeTextTo(java.io.Writer out,
                        boolean cache)
                 throws java.io.IOException
Specified by:
writeTextTo in interface OMElement
Overrides:
writeTextTo in class OMElementImpl
Throws:
java.io.IOException

getLocalName

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

Specified by:
getLocalName in interface OMNamedInformationItem
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 OMNamedInformationItem
Overrides:
setLocalName in class OMElementImpl

getNamespace

public OMNamespace getNamespace()
                         throws OMException
Specified by:
getNamespace in interface OMNamedInformationItem
Overrides:
getNamespace in class OMElementImpl
Throws:
OMException

getPrefix

public java.lang.String getPrefix()
Specified by:
getPrefix in interface OMNamedInformationItem
Overrides:
getPrefix in class OMElementImpl

getNamespaceURI

public java.lang.String getNamespaceURI()
Specified by:
getNamespaceURI in interface OMNamedInformationItem
Overrides:
getNamespaceURI in class OMElementImpl

setNamespace

public void setNamespace(OMNamespace namespace)
Specified by:
setNamespace in interface OMElement
Overrides:
setNamespace in class OMElementImpl

setNamespaceWithNoFindInCurrentScope

public void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
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 OMNamedInformationItem
Overrides:
getQName in class OMElementImpl
Returns:
Returns QName.

toStringWithConsume

public java.lang.String toStringWithConsume()
                                     throws javax.xml.stream.XMLStreamException
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)
Specified by:
resolveQName in interface OMElement
Overrides:
resolveQName in class OMElementImpl

cloneOMElement

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

clone

public OMInformationItem clone(OMCloneOptions options)
Specified by:
clone in interface OMInformationItem
Overrides:
clone in class OMNodeImpl

createClone

protected OMElement createClone(OMCloneOptions options,
                                OMContainer targetParent)
Overrides:
createClone in class OMElementImpl

createClone

protected OMSourcedElement createClone(OMCloneOptions options,
                                       OMDataSource ds)

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()
Specified by:
getType in interface OMNode
Overrides:
getType in class OMElementImpl

internalSerialize

public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
                              boolean cache)
                       throws javax.xml.stream.XMLStreamException
Description copied from class: OMSerializableImpl
Serializes the node.

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

serialize

public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface OMSerializable
Overrides:
serialize in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.OutputStream output)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface OMContainer
Specified by:
serialize in interface OMElement
Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.Writer writer)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface OMContainer
Specified by:
serialize in interface OMElement
Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.OutputStream output,
                      OMOutputFormat format)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface OMContainer
Specified by:
serialize in interface OMElement
Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serialize

public void serialize(java.io.Writer writer,
                      OMOutputFormat format)
               throws javax.xml.stream.XMLStreamException
Specified by:
serialize in interface OMContainer
Specified by:
serialize in interface OMElement
Specified by:
serialize in interface OMNode
Overrides:
serialize in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
                         throws javax.xml.stream.XMLStreamException
Specified by:
serializeAndConsume in interface OMSerializable
Overrides:
serializeAndConsume in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(java.io.OutputStream output)
                         throws javax.xml.stream.XMLStreamException
Specified by:
serializeAndConsume in interface OMContainer
Specified by:
serializeAndConsume in interface OMElement
Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(java.io.Writer writer)
                         throws javax.xml.stream.XMLStreamException
Specified by:
serializeAndConsume in interface OMContainer
Specified by:
serializeAndConsume in interface OMElement
Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(java.io.OutputStream output,
                                OMOutputFormat format)
                         throws javax.xml.stream.XMLStreamException
Specified by:
serializeAndConsume in interface OMContainer
Specified by:
serializeAndConsume in interface OMElement
Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

serializeAndConsume

public void serializeAndConsume(java.io.Writer writer,
                                OMOutputFormat format)
                         throws javax.xml.stream.XMLStreamException
Specified by:
serializeAndConsume in interface OMContainer
Specified by:
serializeAndConsume in interface OMElement
Specified by:
serializeAndConsume in interface OMNode
Overrides:
serializeAndConsume in class OMSerializableImpl
Throws:
javax.xml.stream.XMLStreamException

addChild

public void addChild(OMNode omNode)
Specified by:
addChild in interface OMContainer
Overrides:
addChild in class OMElementImpl

addChild

public void addChild(OMNode omNode,
                     boolean fromBuilder)
Specified by:
addChild in interface OMContainerEx
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

getChildrenWithLocalName

public java.util.Iterator getChildrenWithLocalName(java.lang.String localName)
Specified by:
getChildrenWithLocalName in interface OMContainer
Overrides:
getChildrenWithLocalName in class OMElementImpl

getChildrenWithNamespaceURI

public java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)
Specified by:
getChildrenWithNamespaceURI in interface OMContainer
Overrides:
getChildrenWithNamespaceURI 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.

getDescendants

public java.util.Iterator getDescendants(boolean includeSelf)
Specified by:
getDescendants in interface OMContainer
Overrides:
getDescendants in class OMElementImpl

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.

getFirstOMChildIfAvailable

public OMNode getFirstOMChildIfAvailable()
Specified by:
getFirstOMChildIfAvailable in interface IParentNode
Overrides:
getFirstOMChildIfAvailable in class OMElementImpl

getLastKnownOMChild

public OMNode getLastKnownOMChild()
Specified by:
getLastKnownOMChild in interface IContainer
Overrides:
getLastKnownOMChild 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: OMNodeImpl
Returns the next sibling. This can be an OMAttribute or OMText or OMElement for others.

Specified by:
getNextOMSibling in interface OMNode
Overrides:
getNextOMSibling in class OMNodeImpl
Returns:
Returns OMNode.
Throws:
OMException

getNextOMSiblingIfAvailable

public OMNode getNextOMSiblingIfAvailable()
Specified by:
getNextOMSiblingIfAvailable in interface OMNodeEx
Overrides:
getNextOMSiblingIfAvailable in class OMNodeImpl

getState

public int getState()
Specified by:
getState in interface IParentNode
Overrides:
getState in class OMElementImpl

isComplete

public boolean isComplete()
Specified by:
isComplete in interface IParentNode
Specified by:
isComplete in interface OMSerializable
Overrides:
isComplete in class OMElementImpl

toString

public java.lang.String toString()
Specified by:
toString in interface OMElement
Overrides:
toString in class OMElementImpl

buildWithAttachments

public void buildWithAttachments()
Description copied from class: OMNodeImpl
Parses this node and builds the object structure in memory. AXIOM supports two levels of deffered building. First is deffered building of AXIOM using StAX. Second level is the deffered building of attachments. AXIOM reads in the attachements from the stream only when user asks by calling getDataHandler(). build() method builds the OM without the attachments. buildAll() builds the OM together with attachement data. This becomes handy when user wants to free the input stream.

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

build

public void build()
           throws OMException
Specified by:
build in interface OMSerializable
Overrides:
build in class OMElementImpl
Throws:
OMException

getDataSource

public OMDataSource getDataSource()
Provide access to the data source encapsulated in OMSourcedElement. This is usesful when we want to access the raw data in the data source.

Specified by:
getDataSource in interface OMSourcedElement
Returns:
the internal datasource

setDataSource

public OMDataSource setDataSource(OMDataSource dataSource)
setOMDataSource

Specified by:
setDataSource in interface OMSourcedElement

setComplete

public void setComplete(boolean value)
setComplete override The OMSourcedElement has its own isolated builder/reader during the expansion process. Thus calls to setCompete should stop here and not propogate up to the parent (which may have a different builder or no builder).

Specified by:
setComplete in interface OMContainerEx
Specified by:
setComplete in interface OMNodeEx
Overrides:
setComplete in class OMElementImpl

discarded

public void discarded()
Specified by:
discarded in interface OMContainerEx
Overrides:
discarded in class OMElementImpl

getSAXSource

public javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)
Specified by:
getSAXSource in interface OMContainer
Overrides:
getSAXSource in class OMElementImpl

getObject

public java.lang.Object getObject(java.lang.Class dataSourceClass)
Specified by:
getObject in interface OMSourcedElement

removeChildren

public void removeChildren()
Specified by:
removeChildren in interface OMContainer
Overrides:
removeChildren in class OMElementImpl


Copyright © 2004-2012 The Apache Software Foundation. All Rights Reserved.