Class OMSourcedElementImpl
- java.lang.Object
-
- org.apache.axiom.om.impl.llom.OMSerializableImpl
-
- org.apache.axiom.om.impl.llom.OMNodeImpl
-
- org.apache.axiom.om.impl.llom.OMElementImpl
-
- org.apache.axiom.om.impl.llom.OMSourcedElementImpl
-
- All Implemented Interfaces:
org.apache.axiom.om.impl.OMContainerEx,org.apache.axiom.om.impl.OMNodeEx,org.apache.axiom.om.OMConstants,org.apache.axiom.om.OMContainer,org.apache.axiom.om.OMElement,org.apache.axiom.om.OMNode,org.apache.axiom.om.OMSerializable,org.apache.axiom.om.OMSourcedElement
- Direct Known Subclasses:
SOAPHeaderBlockImpl
public class OMSourcedElementImpl extends OMElementImpl implements org.apache.axiom.om.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
OMElementImplclass 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 theforceExpand()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, DEFAULT_DEFAULT_NS_OBJECT, firstChild, lastChild, localName, namespaces, noPrefixNamespaceCounter, ns, qName
-
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
nextSibling, nodeType, parent, previousSibling
-
Fields inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl
builder, done, factory
-
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
Constructors Constructor Description OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMXMLParserWrapper builder, org.apache.axiom.om.OMFactory factory)OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMFactory factory)OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMDataSource source)Constructor.OMSourcedElementImpl(QName qName, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMDataSource source)Constructor that takes a QName instead of the local name and the namespace seperately
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.apache.axiom.om.OMAttributeaddAttribute(String attributeName, String value, org.apache.axiom.om.OMNamespace namespace)org.apache.axiom.om.OMAttributeaddAttribute(org.apache.axiom.om.OMAttribute attr)Inserts an attribute to this element.voidaddChild(org.apache.axiom.om.OMNode omNode)Adds child to the element.voidbuild()Parses this node and builds the object structure in memory.voidbuildNext()Forces the parser to proceed, if parser has not yet finished with the XML input.voidbuildWithAttachments()Parses this node and builds the object structure in memory.org.apache.axiom.om.OMElementcloneOMElement()org.apache.axiom.om.OMNamespacedeclareDefaultNamespace(String uri)We use "" to store the default namespace of this element.org.apache.axiom.om.OMNamespacedeclareNamespace(String uri, String prefix)Creates a namespace in the current element scope.org.apache.axiom.om.OMNamespacedeclareNamespace(org.apache.axiom.om.OMNamespace namespace)org.apache.axiom.om.OMNodedetach()Removes this information item and its children, from the model completely.voiddiscard()Method discard.org.apache.axiom.om.OMNamespacefindNamespace(String uri, String prefix)Finds a namespace with the given uri and prefix, in the scope of the document.org.apache.axiom.om.OMNamespacefindNamespaceURI(String prefix)IteratorgetAllAttributes()Returns a List of OMAttributes.IteratorgetAllDeclaredNamespaces()Method getAllDeclaredNamespaces.org.apache.axiom.om.OMAttributegetAttribute(QName qname)Returns a named attribute if present.StringgetAttributeValue(QName qname)Returns a named attribute's value, if present.org.apache.axiom.om.OMXMLParserWrappergetBuilder()Method getBuilder.IteratorgetChildElements()Returns a filtered list of children - just the elements.IteratorgetChildren()Returns a collection of this element.IteratorgetChildrenWithLocalName(String localName)IteratorgetChildrenWithName(QName elementQName)Searches for children with a given QName and returns an iterator to traverse through the OMNodes.IteratorgetChildrenWithNamespaceURI(String uri)org.apache.axiom.om.OMDataSourcegetDataSource()Provide access to the data source encapsulated in OMSourcedElement.org.apache.axiom.om.OMNamespacegetDefaultNamespace()org.apache.axiom.om.OMElementgetFirstChildWithName(QName elementQName)Method getFirstChildWithName.org.apache.axiom.om.OMElementgetFirstElement()Gets first element.org.apache.axiom.om.OMNodegetFirstOMChild()Method getFirstOMChild.org.apache.axiom.om.OMNodegetFirstOMChildIfAvailable()intgetLineNumber()StringgetLocalName()Method getLocalName.org.apache.axiom.om.OMNamespacegetNamespace()org.apache.axiom.om.OMNodegetNextOMSibling()Gets the next sibling.org.apache.axiom.om.OMNodegetNextOMSiblingIfAvailable()QNamegetQName()Method getQName.StringgetText()Selects all the text children and concatenates them to a single string.QNamegetTextAsQName()StringgetTrimmedText()Returns the concatination string of TRIMMED values of all OMText child nodes of this element.intgetType()Gets the type of node, as this is the super class of all the nodes.XMLStreamReadergetXMLStreamReader()XMLStreamReadergetXMLStreamReader(boolean cache)XMLStreamReadergetXMLStreamReader(boolean cache, boolean preserveNamespaceContext)XMLStreamReadergetXMLStreamReaderWithoutCaching()voidinternalSerialize(XMLStreamWriter writer, boolean cache)Serializes the node.booleanisComplete()booleanisExpanded()Check if element has been expanded into tree.protected voidnotifyChildComplete()This method will be called when one of the children becomes complete.voidremoveAttribute(org.apache.axiom.om.OMAttribute attr)Method removeAttribute.QNameresolveQName(String qname)Converts a prefix:local qname string into a proper QName, evaluating it in the OMElement context.voidserialize(OutputStream output)voidserialize(OutputStream output, org.apache.axiom.om.OMOutputFormat format)voidserialize(Writer writer)voidserialize(Writer writer, org.apache.axiom.om.OMOutputFormat format)voidserialize(XMLStreamWriter xmlWriter)voidserializeAndConsume(OutputStream output)voidserializeAndConsume(OutputStream output, org.apache.axiom.om.OMOutputFormat format)voidserializeAndConsume(Writer writer)voidserializeAndConsume(Writer writer, org.apache.axiom.om.OMOutputFormat format)voidserializeAndConsume(XMLStreamWriter xmlWriter)voidsetBuilder(org.apache.axiom.om.OMXMLParserWrapper wrapper)Method setBuilder.voidsetComplete(boolean value)setComplete override The OMSourcedElement has its own isolated builder/reader during the expansion process.org.apache.axiom.om.OMDataSourcesetDataSource(org.apache.axiom.om.OMDataSource dataSource)setOMDataSourcevoidsetFirstChild(org.apache.axiom.om.OMNode node)Method setFirstChild.voidsetLastChild(org.apache.axiom.om.OMNode omNode)voidsetLineNumber(int lineNumber)voidsetLocalName(String localName)Method setLocalName.voidsetNamespace(org.apache.axiom.om.OMNamespace namespace)Method setNamespace.voidsetNamespaceWithNoFindInCurrentScope(org.apache.axiom.om.OMNamespace namespace)voidsetText(String text)Sets the text of the given element.voidsetText(QName text)Sets the text, as a QName, of the given element.StringtoString()StringtoStringWithConsume()-
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
getParent, getPreviousOMSibling, importNode, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling, setType
-
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
-
-
-
-
Constructor Detail
-
OMSourcedElementImpl
public OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMDataSource source)
Constructor.- Parameters:
localName-ns-factory-source-
-
OMSourcedElementImpl
public OMSourcedElementImpl(QName qName, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMDataSource source)
Constructor that takes a QName instead of the local name and the namespace seperately- Parameters:
qName-factory-source-
-
OMSourcedElementImpl
public OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
-
OMSourcedElementImpl
public OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMXMLParserWrapper builder, org.apache.axiom.om.OMFactory factory)
-
OMSourcedElementImpl
public OMSourcedElementImpl(String localName, org.apache.axiom.om.OMNamespace ns, org.apache.axiom.om.OMFactory factory)
-
-
Method Detail
-
isExpanded
public boolean isExpanded()
Check if element has been expanded into tree.- Specified by:
isExpandedin interfaceorg.apache.axiom.om.OMSourcedElement- Returns:
trueif expanded,falseif not
-
getChildElements
public Iterator getChildElements()
Description copied from class:OMElementImplReturns a filtered list of children - just the elements.- Specified by:
getChildElementsin interfaceorg.apache.axiom.om.OMElement- Overrides:
getChildElementsin classOMElementImpl- Returns:
- Returns an iterator of the child elements.
-
declareNamespace
public org.apache.axiom.om.OMNamespace declareNamespace(String uri, String prefix)
Description copied from class:OMElementImplCreates a namespace in the current element scope.- Specified by:
declareNamespacein interfaceorg.apache.axiom.om.OMElement- Overrides:
declareNamespacein classOMElementImpl- Returns:
- Returns namespace.
-
declareDefaultNamespace
public org.apache.axiom.om.OMNamespace declareDefaultNamespace(String uri)
Description copied from class:OMElementImplWe 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:
declareDefaultNamespacein interfaceorg.apache.axiom.om.OMElement- Overrides:
declareDefaultNamespacein classOMElementImpl
-
getDefaultNamespace
public org.apache.axiom.om.OMNamespace getDefaultNamespace()
- Specified by:
getDefaultNamespacein interfaceorg.apache.axiom.om.OMElement- Overrides:
getDefaultNamespacein classOMElementImpl
-
declareNamespace
public org.apache.axiom.om.OMNamespace declareNamespace(org.apache.axiom.om.OMNamespace namespace)
- Specified by:
declareNamespacein interfaceorg.apache.axiom.om.OMElement- Overrides:
declareNamespacein classOMElementImpl- Returns:
- Returns namespace.
-
findNamespace
public org.apache.axiom.om.OMNamespace findNamespace(String uri, String prefix)
Description copied from class:OMElementImplFinds 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:
findNamespacein interfaceorg.apache.axiom.om.OMElement- Overrides:
findNamespacein classOMElementImpl
-
findNamespaceURI
public org.apache.axiom.om.OMNamespace findNamespaceURI(String prefix)
- Specified by:
findNamespaceURIin interfaceorg.apache.axiom.om.OMElement- Overrides:
findNamespaceURIin classOMElementImpl
-
getAllDeclaredNamespaces
public Iterator getAllDeclaredNamespaces() throws org.apache.axiom.om.OMException
Description copied from class:OMElementImplMethod getAllDeclaredNamespaces.- Specified by:
getAllDeclaredNamespacesin interfaceorg.apache.axiom.om.OMElement- Overrides:
getAllDeclaredNamespacesin classOMElementImpl- Returns:
- Returns Iterator.
- Throws:
org.apache.axiom.om.OMException
-
getAllAttributes
public Iterator getAllAttributes()
Description copied from class:OMElementImplReturns a List of OMAttributes.- Specified by:
getAllAttributesin interfaceorg.apache.axiom.om.OMElement- Overrides:
getAllAttributesin classOMElementImpl- Returns:
- Returns iterator.
-
getAttribute
public org.apache.axiom.om.OMAttribute getAttribute(QName qname)
Description copied from class:OMElementImplReturns a named attribute if present.- Specified by:
getAttributein interfaceorg.apache.axiom.om.OMElement- Overrides:
getAttributein classOMElementImpl- Parameters:
qname- the qualified name to search for- Returns:
- Returns an OMAttribute with the given name if found, or null
-
getAttributeValue
public String getAttributeValue(QName qname)
Description copied from class:OMElementImplReturns a named attribute's value, if present.- Specified by:
getAttributeValuein interfaceorg.apache.axiom.om.OMElement- Overrides:
getAttributeValuein classOMElementImpl- Parameters:
qname- the qualified name to search for- Returns:
- Returns a String containing the attribute value, or null.
-
addAttribute
public org.apache.axiom.om.OMAttribute addAttribute(org.apache.axiom.om.OMAttribute attr)
Description copied from class:OMElementImplInserts 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 particularOMElement.- Specified by:
addAttributein interfaceorg.apache.axiom.om.OMElement- Overrides:
addAttributein classOMElementImpl- 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 org.apache.axiom.om.OMAttribute addAttribute(String attributeName, String value, org.apache.axiom.om.OMNamespace namespace)
- Specified by:
addAttributein interfaceorg.apache.axiom.om.OMElement- Overrides:
addAttributein classOMElementImpl
-
removeAttribute
public void removeAttribute(org.apache.axiom.om.OMAttribute attr)
Description copied from class:OMElementImplMethod removeAttribute.- Specified by:
removeAttributein interfaceorg.apache.axiom.om.OMElement- Overrides:
removeAttributein classOMElementImpl
-
setBuilder
public void setBuilder(org.apache.axiom.om.OMXMLParserWrapper wrapper)
Description copied from class:OMElementImplMethod setBuilder.- Specified by:
setBuilderin interfaceorg.apache.axiom.om.OMElement- Overrides:
setBuilderin classOMElementImpl
-
getBuilder
public org.apache.axiom.om.OMXMLParserWrapper getBuilder()
Description copied from class:OMElementImplMethod getBuilder.- Specified by:
getBuilderin interfaceorg.apache.axiom.om.OMContainer- Overrides:
getBuilderin classOMElementImpl- Returns:
- Returns OMXMLParserWrapper.
-
setFirstChild
public void setFirstChild(org.apache.axiom.om.OMNode node)
Description copied from class:OMElementImplMethod setFirstChild.- Specified by:
setFirstChildin interfaceorg.apache.axiom.om.impl.OMContainerEx- Specified by:
setFirstChildin interfaceorg.apache.axiom.om.OMElement- Overrides:
setFirstChildin classOMElementImpl
-
setLastChild
public void setLastChild(org.apache.axiom.om.OMNode omNode)
- Specified by:
setLastChildin interfaceorg.apache.axiom.om.impl.OMContainerEx- Overrides:
setLastChildin classOMElementImpl
-
getFirstElement
public org.apache.axiom.om.OMElement getFirstElement()
Description copied from class:OMElementImplGets first element.- Specified by:
getFirstElementin interfaceorg.apache.axiom.om.OMElement- Overrides:
getFirstElementin classOMElementImpl- Returns:
- Returns element.
-
getXMLStreamReader
public XMLStreamReader getXMLStreamReader(boolean cache)
- Specified by:
getXMLStreamReaderin interfaceorg.apache.axiom.om.OMContainer- Overrides:
getXMLStreamReaderin classOMElementImpl
-
getXMLStreamReader
public XMLStreamReader getXMLStreamReader(boolean cache, boolean preserveNamespaceContext)
- Specified by:
getXMLStreamReaderin interfaceorg.apache.axiom.om.OMElement- Overrides:
getXMLStreamReaderin classOMElementImpl
-
getXMLStreamReader
public XMLStreamReader getXMLStreamReader()
- Specified by:
getXMLStreamReaderin interfaceorg.apache.axiom.om.OMContainer- Overrides:
getXMLStreamReaderin classOMElementImpl
-
getXMLStreamReaderWithoutCaching
public XMLStreamReader getXMLStreamReaderWithoutCaching()
- Specified by:
getXMLStreamReaderWithoutCachingin interfaceorg.apache.axiom.om.OMContainer- Overrides:
getXMLStreamReaderWithoutCachingin classOMElementImpl
-
setText
public void setText(String text)
Description copied from class:OMElementImplSets 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:
setTextin interfaceorg.apache.axiom.om.OMElement- Overrides:
setTextin classOMElementImpl
-
setText
public void setText(QName text)
Description copied from class:OMElementImplSets 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:
setTextin interfaceorg.apache.axiom.om.OMElement- Overrides:
setTextin classOMElementImpl
-
getText
public String getText()
Description copied from class:OMElementImplSelects all the text children and concatenates them to a single string.- Specified by:
getTextin interfaceorg.apache.axiom.om.OMElement- Overrides:
getTextin classOMElementImpl- Returns:
- Returns String.
-
getTextAsQName
public QName getTextAsQName()
- Specified by:
getTextAsQNamein interfaceorg.apache.axiom.om.OMElement- Overrides:
getTextAsQNamein classOMElementImpl
-
getLocalName
public String getLocalName()
Description copied from class:OMElementImplMethod getLocalName.- Specified by:
getLocalNamein interfaceorg.apache.axiom.om.OMElement- Overrides:
getLocalNamein classOMElementImpl- Returns:
- Returns local name.
-
setLocalName
public void setLocalName(String localName)
Description copied from class:OMElementImplMethod setLocalName.- Specified by:
setLocalNamein interfaceorg.apache.axiom.om.OMElement- Overrides:
setLocalNamein classOMElementImpl
-
getNamespace
public org.apache.axiom.om.OMNamespace getNamespace() throws org.apache.axiom.om.OMException- Specified by:
getNamespacein interfaceorg.apache.axiom.om.OMElement- Overrides:
getNamespacein classOMElementImpl- Throws:
org.apache.axiom.om.OMException
-
setNamespace
public void setNamespace(org.apache.axiom.om.OMNamespace namespace)
Description copied from class:OMElementImplMethod setNamespace.- Specified by:
setNamespacein interfaceorg.apache.axiom.om.OMElement- Overrides:
setNamespacein classOMElementImpl
-
setNamespaceWithNoFindInCurrentScope
public void setNamespaceWithNoFindInCurrentScope(org.apache.axiom.om.OMNamespace namespace)
- Specified by:
setNamespaceWithNoFindInCurrentScopein interfaceorg.apache.axiom.om.OMElement- Overrides:
setNamespaceWithNoFindInCurrentScopein classOMElementImpl
-
getQName
public QName getQName()
Description copied from class:OMElementImplMethod getQName.- Specified by:
getQNamein interfaceorg.apache.axiom.om.OMElement- Overrides:
getQNamein classOMElementImpl- Returns:
- Returns QName.
-
toStringWithConsume
public String toStringWithConsume() throws XMLStreamException
- Specified by:
toStringWithConsumein interfaceorg.apache.axiom.om.OMElement- Overrides:
toStringWithConsumein classOMElementImpl- Throws:
XMLStreamException
-
resolveQName
public QName resolveQName(String qname)
Description copied from class:OMElementImplConverts a prefix:local qname string into a proper QName, evaluating it in the OMElement context. Unprefixed qnames resolve to the local namespace.- Specified by:
resolveQNamein interfaceorg.apache.axiom.om.OMElement- Overrides:
resolveQNamein classOMElementImpl- Parameters:
qname- prefixed qname string to resolve- Returns:
- Returns null for any failure to extract a qname.
-
cloneOMElement
public org.apache.axiom.om.OMElement cloneOMElement()
- Specified by:
cloneOMElementin interfaceorg.apache.axiom.om.OMElement- Overrides:
cloneOMElementin classOMElementImpl
-
setLineNumber
public void setLineNumber(int lineNumber)
- Specified by:
setLineNumberin interfaceorg.apache.axiom.om.OMElement- Overrides:
setLineNumberin classOMElementImpl
-
getLineNumber
public int getLineNumber()
- Specified by:
getLineNumberin interfaceorg.apache.axiom.om.OMElement- Overrides:
getLineNumberin classOMElementImpl
-
discard
public void discard() throws org.apache.axiom.om.OMExceptionDescription copied from class:OMElementImplMethod discard.- Specified by:
discardin interfaceorg.apache.axiom.om.OMNode- Overrides:
discardin classOMElementImpl- Throws:
org.apache.axiom.om.OMException
-
getType
public int getType()
Description copied from class:OMElementImplGets the type of node, as this is the super class of all the nodes.- Specified by:
getTypein interfaceorg.apache.axiom.om.OMNode- Overrides:
getTypein classOMElementImpl- Returns:
- Returns the type of node as indicated by
OMNodeImpl.setType(int) - See Also:
OMNodeImpl.setType(int)
-
internalSerialize
public void internalSerialize(XMLStreamWriter writer, boolean cache) throws XMLStreamException
Description copied from class:OMSerializableImplSerializes the node.- Specified by:
internalSerializein interfaceorg.apache.axiom.om.impl.OMNodeEx- Overrides:
internalSerializein classOMElementImpl- Throws:
XMLStreamException
-
serialize
public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException
- Specified by:
serializein interfaceorg.apache.axiom.om.OMSerializable- Overrides:
serializein classOMSerializableImpl- Throws:
XMLStreamException
-
serialize
public void serialize(OutputStream output) throws XMLStreamException
- Specified by:
serializein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializein classOMSerializableImpl- Throws:
XMLStreamException
-
serialize
public void serialize(Writer writer) throws XMLStreamException
- Specified by:
serializein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializein classOMSerializableImpl- Throws:
XMLStreamException
-
serialize
public void serialize(OutputStream output, org.apache.axiom.om.OMOutputFormat format) throws XMLStreamException
- Specified by:
serializein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializein classOMSerializableImpl- Throws:
XMLStreamException
-
serialize
public void serialize(Writer writer, org.apache.axiom.om.OMOutputFormat format) throws XMLStreamException
- Specified by:
serializein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializein classOMSerializableImpl- Throws:
XMLStreamException
-
serializeAndConsume
public void serializeAndConsume(XMLStreamWriter xmlWriter) throws XMLStreamException
- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMSerializable- Overrides:
serializeAndConsumein classOMSerializableImpl- Throws:
XMLStreamException
-
serializeAndConsume
public void serializeAndConsume(OutputStream output) throws XMLStreamException
- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializeAndConsumein classOMSerializableImpl- Throws:
XMLStreamException
-
serializeAndConsume
public void serializeAndConsume(Writer writer) throws XMLStreamException
- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializeAndConsumein classOMSerializableImpl- Throws:
XMLStreamException
-
serializeAndConsume
public void serializeAndConsume(OutputStream output, org.apache.axiom.om.OMOutputFormat format) throws XMLStreamException
- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializeAndConsumein classOMSerializableImpl- Throws:
XMLStreamException
-
serializeAndConsume
public void serializeAndConsume(Writer writer, org.apache.axiom.om.OMOutputFormat format) throws XMLStreamException
- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMContainer- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMElement- Specified by:
serializeAndConsumein interfaceorg.apache.axiom.om.OMNode- Overrides:
serializeAndConsumein classOMSerializableImpl- Throws:
XMLStreamException
-
addChild
public void addChild(org.apache.axiom.om.OMNode omNode)
Description copied from class:OMElementImplAdds child to the element. One can decide whether to append the child or to add to the front of the children list.- Specified by:
addChildin interfaceorg.apache.axiom.om.OMContainer- Overrides:
addChildin classOMElementImpl
-
getChildrenWithName
public Iterator getChildrenWithName(QName elementQName)
Description copied from class:OMElementImplSearches 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:
getChildrenWithNamein interfaceorg.apache.axiom.om.OMContainer- Overrides:
getChildrenWithNamein classOMElementImpl
-
getChildrenWithLocalName
public Iterator getChildrenWithLocalName(String localName)
- Specified by:
getChildrenWithLocalNamein interfaceorg.apache.axiom.om.OMContainer- Overrides:
getChildrenWithLocalNamein classOMElementImpl
-
getChildrenWithNamespaceURI
public Iterator getChildrenWithNamespaceURI(String uri)
- Specified by:
getChildrenWithNamespaceURIin interfaceorg.apache.axiom.om.OMContainer- Overrides:
getChildrenWithNamespaceURIin classOMElementImpl
-
getFirstChildWithName
public org.apache.axiom.om.OMElement getFirstChildWithName(QName elementQName) throws org.apache.axiom.om.OMException
Description copied from class:OMElementImplMethod getFirstChildWithName.- Specified by:
getFirstChildWithNamein interfaceorg.apache.axiom.om.OMContainer- Overrides:
getFirstChildWithNamein classOMElementImpl- Throws:
org.apache.axiom.om.OMException
-
getChildren
public Iterator getChildren()
Description copied from class:OMElementImplReturns a collection of this element. Children can be of types OMElement, OMText.- Specified by:
getChildrenin interfaceorg.apache.axiom.om.OMContainer- Overrides:
getChildrenin classOMElementImpl- Returns:
- Returns children.
-
getFirstOMChild
public org.apache.axiom.om.OMNode getFirstOMChild()
Description copied from class:OMElementImplMethod getFirstOMChild.- Specified by:
getFirstOMChildin interfaceorg.apache.axiom.om.OMContainer- Overrides:
getFirstOMChildin classOMElementImpl- Returns:
- Returns child.
-
getFirstOMChildIfAvailable
public org.apache.axiom.om.OMNode getFirstOMChildIfAvailable()
- Specified by:
getFirstOMChildIfAvailablein interfaceorg.apache.axiom.om.impl.OMContainerEx- Overrides:
getFirstOMChildIfAvailablein classOMElementImpl
-
buildNext
public void buildNext()
Description copied from class:OMElementImplForces the parser to proceed, if parser has not yet finished with the XML input.- Specified by:
buildNextin interfaceorg.apache.axiom.om.OMContainer- Overrides:
buildNextin classOMElementImpl
-
detach
public org.apache.axiom.om.OMNode detach() throws org.apache.axiom.om.OMExceptionDescription copied from class:OMElementImplRemoves this information item and its children, from the model completely.- Specified by:
detachin interfaceorg.apache.axiom.om.OMNode- Overrides:
detachin classOMElementImpl- Throws:
org.apache.axiom.om.OMException
-
getNextOMSibling
public org.apache.axiom.om.OMNode getNextOMSibling() throws org.apache.axiom.om.OMExceptionDescription copied from class:OMElementImplGets the next sibling. This can be an OMAttribute or OMText or OMELement for others.- Specified by:
getNextOMSiblingin interfaceorg.apache.axiom.om.OMNode- Overrides:
getNextOMSiblingin classOMElementImpl- Returns:
- Returns OMNode.
- Throws:
org.apache.axiom.om.OMException
-
getNextOMSiblingIfAvailable
public org.apache.axiom.om.OMNode getNextOMSiblingIfAvailable()
- Specified by:
getNextOMSiblingIfAvailablein interfaceorg.apache.axiom.om.impl.OMNodeEx- Overrides:
getNextOMSiblingIfAvailablein classOMNodeImpl
-
getTrimmedText
public String getTrimmedText()
Description copied from class:OMElementImplReturns the concatination string of TRIMMED values of all OMText child nodes of this element. This is included purely to improve usability.- Overrides:
getTrimmedTextin classOMElementImpl
-
isComplete
public boolean isComplete()
- Specified by:
isCompletein interfaceorg.apache.axiom.om.OMSerializable- Overrides:
isCompletein classOMSerializableImpl
-
toString
public String toString()
- Specified by:
toStringin interfaceorg.apache.axiom.om.OMElement- Overrides:
toStringin classOMElementImpl
-
buildWithAttachments
public void buildWithAttachments()
Description copied from class:OMNodeImplParses 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:
buildWithAttachmentsin interfaceorg.apache.axiom.om.OMNode- Overrides:
buildWithAttachmentsin classOMElementImpl
-
build
public void build() throws org.apache.axiom.om.OMExceptionDescription copied from class:OMSerializableImplParses this node and builds the object structure in memory. However a node, created programmatically, will have done set to true by default and this will cause populateyourself not to work properly!- Specified by:
buildin interfaceorg.apache.axiom.om.OMSerializable- Overrides:
buildin classOMElementImpl- Throws:
org.apache.axiom.om.OMException
-
notifyChildComplete
protected void notifyChildComplete()
Description copied from class:OMElementImplThis method will be called when one of the children becomes complete.- Overrides:
notifyChildCompletein classOMElementImpl
-
getDataSource
public org.apache.axiom.om.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:
getDataSourcein interfaceorg.apache.axiom.om.OMSourcedElement- Returns:
- the internal datasource
-
setDataSource
public org.apache.axiom.om.OMDataSource setDataSource(org.apache.axiom.om.OMDataSource dataSource)
setOMDataSource- Specified by:
setDataSourcein interfaceorg.apache.axiom.om.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:
setCompletein interfaceorg.apache.axiom.om.impl.OMContainerEx- Specified by:
setCompletein interfaceorg.apache.axiom.om.impl.OMNodeEx- Overrides:
setCompletein classOMNodeImpl
-
-