|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.axiom.om.impl.llom.OMNodeImpl
org.apache.axiom.om.impl.llom.OMElementImpl
org.apache.axiom.om.impl.llom.OMSourcedElementImpl
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 |
public OMSourcedElementImpl(java.lang.String localName,
OMNamespace ns,
OMFactory factory,
OMDataSource source)
localName - ns - factory - source - | Method Detail |
public boolean isExpanded()
true if expanded, false if notpublic java.util.Iterator getChildElements()
OMElementImpl
getChildElements in interface OMElementgetChildElements in class OMElementImpl
public OMNamespace declareNamespace(java.lang.String uri,
java.lang.String prefix)
OMElementImpl
declareNamespace in interface OMElementdeclareNamespace in class OMElementImplpublic OMNamespace declareDefaultNamespace(java.lang.String uri)
OMElementImpl
declareDefaultNamespace in interface OMElementdeclareDefaultNamespace in class OMElementImpluri - public OMNamespace getDefaultNamespace()
OMElement
getDefaultNamespace in interface OMElementgetDefaultNamespace in class OMElementImplpublic OMNamespace declareNamespace(OMNamespace namespace)
OMElement
declareNamespace in interface OMElementdeclareNamespace in class OMElementImpl
public OMNamespace findNamespace(java.lang.String uri,
java.lang.String prefix)
OMElementImpl
findNamespace in interface OMElementfindNamespace in class OMElementImplpublic OMNamespace findNamespaceURI(java.lang.String prefix)
OMElement
findNamespaceURI in interface OMElementfindNamespaceURI in class OMElementImpl
public java.util.Iterator getAllDeclaredNamespaces()
throws OMException
OMElementImpl
getAllDeclaredNamespaces in interface OMElementgetAllDeclaredNamespaces in class OMElementImplOMExceptionpublic java.util.Iterator getAllAttributes()
OMElementImpl
getAllAttributes in interface OMElementgetAllAttributes in class OMElementImplpublic OMAttribute getAttribute(javax.xml.namespace.QName qname)
OMElementImpl
getAttribute in interface OMElementgetAttribute in class OMElementImplqname - the qualified name to search for
public java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
OMElementImpl
getAttributeValue in interface OMElementgetAttributeValue in class OMElementImplqname - the qualified name to search for
public OMAttribute addAttribute(OMAttribute attr)
OMElementImpl
addAttribute in interface OMElementaddAttribute in class OMElementImpl
public OMAttribute addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace namespace)
OMElementImpl
addAttribute in interface OMElementaddAttribute in class OMElementImplpublic void removeAttribute(OMAttribute attr)
OMElementImpl
removeAttribute in interface OMElementremoveAttribute in class OMElementImplpublic void setBuilder(OMXMLParserWrapper wrapper)
OMElementImpl
setBuilder in interface OMElementsetBuilder in class OMElementImplpublic OMXMLParserWrapper getBuilder()
OMElementImpl
getBuilder in interface OMElementgetBuilder in class OMElementImplpublic void setFirstChild(OMNode node)
OMElementImpl
setFirstChild in interface OMElementsetFirstChild in class OMElementImplpublic OMElement getFirstElement()
OMElementImpl
getFirstElement in interface OMElementgetFirstElement in class OMElementImplpublic javax.xml.stream.XMLStreamReader getXMLStreamReader()
OMElementImpl
getXMLStreamReader in interface OMElementgetXMLStreamReader in class OMElementImplOMElement.getXMLStreamReader()public javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
OMElementImpl
getXMLStreamReaderWithoutCaching in interface OMElementgetXMLStreamReaderWithoutCaching in class OMElementImplOMElement.getXMLStreamReaderWithoutCaching()public void setText(java.lang.String text)
OMElementImpl
setText in interface OMElementsetText in class OMElementImplpublic void setText(javax.xml.namespace.QName text)
OMElementImpl
setText in interface OMElementsetText in class OMElementImplpublic java.lang.String getText()
OMElementImpl
getText in interface OMElementgetText in class OMElementImplpublic javax.xml.namespace.QName getTextAsQName()
OMElement
getTextAsQName in interface OMElementgetTextAsQName in class OMElementImplpublic java.lang.String getLocalName()
OMElementImpl
getLocalName in interface OMElementgetLocalName in class OMElementImplpublic void setLocalName(java.lang.String localName)
OMElementImpl
setLocalName in interface OMElementsetLocalName in class OMElementImpl
public OMNamespace getNamespace()
throws OMException
OMElementImpl
getNamespace in interface OMElementgetNamespace in class OMElementImplOMExceptionpublic void setNamespace(OMNamespace namespace)
OMElementImpl
setNamespace in interface OMElementsetNamespace in class OMElementImplpublic void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
OMElement
setNamespaceWithNoFindInCurrentScope in interface OMElementsetNamespaceWithNoFindInCurrentScope in class OMElementImplpublic javax.xml.namespace.QName getQName()
OMElementImpl
getQName in interface OMElementgetQName in class OMElementImpl
public java.lang.String toStringWithConsume()
throws javax.xml.stream.XMLStreamException
OMElement
toStringWithConsume in interface OMElementtoStringWithConsume in class OMElementImpljavax.xml.stream.XMLStreamExceptionpublic javax.xml.namespace.QName resolveQName(java.lang.String qname)
OMElementImpl
resolveQName in interface OMElementresolveQName in class OMElementImplqname - prefixed qname string to resolve
public OMElement cloneOMElement()
OMElement
cloneOMElement in interface OMElementcloneOMElement in class OMElementImplpublic void setLineNumber(int lineNumber)
setLineNumber in interface OMElementsetLineNumber in class OMElementImplpublic int getLineNumber()
getLineNumber in interface OMElementgetLineNumber in class OMElementImpl
public void discard()
throws OMException
OMElementImpl
discard in interface OMNodediscard in class OMElementImplOMExceptionpublic int getType()
OMElementImpl
getType in interface OMNodegetType in class OMElementImpl
public void internalSerialize(javax.xml.stream.XMLStreamWriter writer)
throws javax.xml.stream.XMLStreamException
OMElementImpl
internalSerialize in interface OMNodeExinternalSerialize in class OMElementImpljavax.xml.stream.XMLStreamException
protected void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
throws javax.xml.stream.XMLStreamException
internalSerialize in class OMElementImpljavax.xml.stream.XMLStreamException
public void internalSerializeAndConsume(javax.xml.stream.XMLStreamWriter writer)
throws javax.xml.stream.XMLStreamException
OMElementImpl
internalSerializeAndConsume in interface OMNodeExinternalSerializeAndConsume in class OMElementImpljavax.xml.stream.XMLStreamException
public void serialize(javax.xml.stream.XMLStreamWriter xmlWriter)
throws javax.xml.stream.XMLStreamException
OMNode
serialize in interface OMNodeserialize in class OMNodeImplxmlWriter -
javax.xml.stream.XMLStreamException
public void serialize(java.io.OutputStream output)
throws javax.xml.stream.XMLStreamException
OMNode
serialize in interface OMNodeserialize in class OMNodeImpljavax.xml.stream.XMLStreamException
public void serialize(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
OMNode
serialize in interface OMNodeserialize in class OMNodeImpljavax.xml.stream.XMLStreamException
public void serialize(java.io.OutputStream output,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
OMNode
serialize in interface OMNodeserialize in class OMNodeImpljavax.xml.stream.XMLStreamException
public void serialize(java.io.Writer writer,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
OMNode
serialize in interface OMNodeserialize in class OMNodeImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(javax.xml.stream.XMLStreamWriter xmlWriter)
throws javax.xml.stream.XMLStreamException
OMNode
serializeAndConsume in interface OMNodeserializeAndConsume in class OMNodeImplxmlWriter -
javax.xml.stream.XMLStreamException#internalSerializeAndConsume(org.apache.axiom.om.impl.MTOMXMLStreamWriter)
public void serializeAndConsume(java.io.OutputStream output)
throws javax.xml.stream.XMLStreamException
OMNode
serializeAndConsume in interface OMNodeserializeAndConsume in class OMNodeImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(java.io.Writer writer)
throws javax.xml.stream.XMLStreamException
OMNode
serializeAndConsume in interface OMNodeserializeAndConsume in class OMNodeImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(java.io.OutputStream output,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
OMNode
serializeAndConsume in interface OMNodeserializeAndConsume in class OMNodeImpljavax.xml.stream.XMLStreamException
public void serializeAndConsume(java.io.Writer writer,
OMOutputFormat format)
throws javax.xml.stream.XMLStreamException
OMNode
serializeAndConsume in interface OMNodeserializeAndConsume in class OMNodeImpljavax.xml.stream.XMLStreamExceptionpublic void addChild(OMNode omNode)
OMElementImpl
addChild in interface OMContaineraddChild in class OMElementImplpublic java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
OMElementImpl
getChildrenWithName in interface OMContainergetChildrenWithName in class OMElementImpl
public OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
throws OMException
OMElementImpl
getFirstChildWithName in interface OMContainergetFirstChildWithName in class OMElementImplOMExceptionpublic java.util.Iterator getChildren()
OMElementImpl
getChildren in interface OMContainergetChildren in class OMElementImplpublic OMNode getFirstOMChild()
OMElementImpl
getFirstOMChild in interface OMContainergetFirstOMChild in class OMElementImplpublic void buildNext()
OMElementImpl
buildNext in interface OMContainerbuildNext in class OMElementImpl
public OMNode detach()
throws OMException
OMElementImpl
detach in interface OMNodedetach in class OMElementImplOMException
public OMNode getNextOMSibling()
throws OMException
OMElementImpl
getNextOMSibling in interface OMNodegetNextOMSibling in class OMElementImplOMExceptionpublic java.lang.String getTrimmedText()
OMElementImpl
getTrimmedText in class OMElementImplpublic boolean isComplete()
OMElementImpl
isComplete in interface OMNodeisComplete in class OMElementImplpublic java.lang.String toString()
OMElement
toString in interface OMElementtoString in class OMElementImpl
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||