|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axiom.om.impl.llom.OMSerializableImpl
org.apache.axiom.om.impl.llom.OMNodeImpl
org.apache.axiom.om.impl.llom.OMElementImpl
public class OMElementImpl
Class OMElementImpl
| Field Summary | |
|---|---|
protected java.util.HashMap |
attributes
Field attributes |
protected OMXMLParserWrapper |
builder
|
protected OMNode |
firstChild
Field firstChild |
protected OMNode |
lastChild
|
protected java.lang.String |
localName
Field localName |
protected java.util.HashMap |
namespaces
Field namespaces |
protected OMNamespace |
ns
The namespace of this element. |
protected javax.xml.namespace.QName |
qName
|
protected int |
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.impl.common.IParentNode |
|---|
COMPLETE, DISCARDED, INCOMPLETE |
| 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 |
| Constructor Summary | |
|---|---|
OMElementImpl(OMContainer parent,
java.lang.String localName,
OMNamespace ns,
OMXMLParserWrapper builder,
OMFactory factory,
boolean generateNSDecl)
|
|
OMElementImpl(javax.xml.namespace.QName qname,
OMContainer parent,
OMFactory factory)
It is assumed that the QName passed contains, at least, the localName for this element. |
|
| Method Summary | |
|---|---|
OMAttribute |
addAttribute(OMAttribute attr)
Inserts an attribute to this element. |
OMAttribute |
addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace ns)
|
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. |
OMElement |
cloneOMElement()
|
protected OMElement |
createClone(OMCloneOptions options,
OMContainer targetParent)
|
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)
|
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()
|
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()
|
void |
removeAttribute(OMAttribute attr)
|
void |
removeChildren()
|
javax.xml.namespace.QName |
resolveQName(java.lang.String qname)
|
void |
setBuilder(OMXMLParserWrapper wrapper)
Method setBuilder. |
void |
setComplete(boolean complete)
|
void |
setFirstChild(OMNode firstChild)
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 qname)
|
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 |
|---|
clone, getIParentNode, getNextOMSibling, getNextOMSiblingIfAvailable, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling |
| Methods inherited from class org.apache.axiom.om.impl.llom.OMSerializableImpl |
|---|
close, getOMFactory, serialize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume |
| 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.OMElement |
|---|
serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume |
| Methods inherited from interface org.apache.axiom.om.impl.common.IChildNode |
|---|
getIParentNode |
| Methods inherited from interface org.apache.axiom.om.impl.OMNodeEx |
|---|
getNextOMSiblingIfAvailable, internalSerialize, internalSerializeAndConsume, setNextOMSibling, setParent, setPreviousOMSibling |
| Methods inherited from interface org.apache.axiom.om.OMNode |
|---|
getNextOMSibling, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore |
| Methods inherited from interface org.apache.axiom.om.OMSerializable |
|---|
close, serialize, serialize, serializeAndConsume |
| Methods inherited from interface org.apache.axiom.om.OMInformationItem |
|---|
clone, getOMFactory |
| Field Detail |
|---|
protected OMXMLParserWrapper builder
protected int state
protected OMNamespace ns
null (if the element has no namespace)
OMNamespace instance, with the following exceptions:
OMNamespace instance with a null prefix
OMNamespace instance with both prefix and namespace URI set to the empty
string
protected java.lang.String localName
protected javax.xml.namespace.QName qName
protected OMNode firstChild
protected java.util.HashMap namespaces
protected java.util.HashMap attributes
protected OMNode lastChild
| Constructor Detail |
|---|
public OMElementImpl(OMContainer parent,
java.lang.String localName,
OMNamespace ns,
OMXMLParserWrapper builder,
OMFactory factory,
boolean generateNSDecl)
public OMElementImpl(javax.xml.namespace.QName qname,
OMContainer parent,
OMFactory factory)
throws OMException
qname - - this should be valid qname according to javax.xml.namespace.QName
OMException| Method Detail |
|---|
public void addChild(OMNode omNode)
addChild in interface OMContainer
public void addChild(OMNode omNode,
boolean fromBuilder)
addChild in interface OMContainerExpublic java.util.Iterator getChildrenWithName(javax.xml.namespace.QName elementQName)
getChildrenWithName in interface OMContainerOMExceptionpublic java.util.Iterator getChildrenWithLocalName(java.lang.String localName)
getChildrenWithLocalName in interface OMContainerpublic java.util.Iterator getChildrenWithNamespaceURI(java.lang.String uri)
getChildrenWithNamespaceURI in interface OMContainer
public OMElement getFirstChildWithName(javax.xml.namespace.QName elementQName)
throws OMException
getFirstChildWithName in interface OMContainerOMExceptionpublic java.util.Iterator getChildren()
getChildren in interface OMContainerpublic java.util.Iterator getDescendants(boolean includeSelf)
getDescendants in interface OMContainerpublic java.util.Iterator getChildElements()
getChildElements in interface OMElement
public OMNamespace declareNamespace(java.lang.String uri,
java.lang.String prefix)
declareNamespace in interface OMElementpublic OMNamespace declareDefaultNamespace(java.lang.String uri)
declareDefaultNamespace in interface OMElementpublic OMNamespace getDefaultNamespace()
getDefaultNamespace in interface OMElement
public OMNamespace addNamespaceDeclaration(java.lang.String uri,
java.lang.String prefix)
addNamespaceDeclaration in interface OMElementExpublic OMNamespace declareNamespace(OMNamespace namespace)
declareNamespace in interface OMElementpublic void undeclarePrefix(java.lang.String prefix)
undeclarePrefix in interface OMElement
public OMNamespace findNamespace(java.lang.String uri,
java.lang.String prefix)
findNamespace in interface OMElementpublic OMNamespace findNamespaceURI(java.lang.String prefix)
findNamespaceURI in interface OMElementpublic java.util.Iterator getAllDeclaredNamespaces()
getAllDeclaredNamespaces in interface OMElementpublic java.util.Iterator getNamespacesInScope()
getNamespacesInScope in interface OMElementpublic javax.xml.namespace.NamespaceContext getNamespaceContext(boolean detached)
getNamespaceContext in interface OMElementpublic java.util.Iterator getAllAttributes()
getAllAttributes in interface OMElementpublic OMAttribute getAttribute(javax.xml.namespace.QName qname)
getAttribute in interface OMElementqname - the qualified name to search for
public java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
getAttributeValue in interface OMElementqname - the qualified name to search for
public OMAttribute addAttribute(OMAttribute attr)
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.
addAttribute in interface OMElementOMAttributeImpl.equals(Object)public void removeAttribute(OMAttribute attr)
removeAttribute in interface OMElement
public OMAttribute addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace ns)
addAttribute in interface OMElementpublic void setBuilder(OMXMLParserWrapper wrapper)
setBuilder in interface OMElementpublic OMXMLParserWrapper getBuilder()
getBuilder in interface IParentNodegetBuilder in interface OMContainergetBuilder in class OMSerializableImplpublic OMNode getFirstOMChild()
getFirstOMChild in interface OMContainerpublic OMNode getFirstOMChildIfAvailable()
getFirstOMChildIfAvailable in interface IParentNodepublic OMNode getLastKnownOMChild()
getLastKnownOMChild in interface IContainerpublic void setFirstChild(OMNode firstChild)
setFirstChild in interface IContainerpublic void setLastChild(OMNode omNode)
setLastChild in interface IContainer
public OMNode detach()
throws OMException
detach in interface OMNodedetach in class OMNodeImplOMExceptionpublic int getType()
getType in interface OMNode
public void build()
throws OMException
build in interface OMSerializableOMExceptionpublic int getState()
getState in interface IParentNodepublic boolean isComplete()
isComplete in interface IParentNodeisComplete in interface OMSerializablepublic void setComplete(boolean complete)
setComplete in interface OMContainerExsetComplete in interface OMNodeExsetComplete in class OMSerializableImplpublic void discarded()
discarded in interface OMContainerExpublic javax.xml.stream.XMLStreamReader getXMLStreamReader()
getXMLStreamReader in interface OMContainerpublic javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
getXMLStreamReaderWithoutCaching in interface OMContainerpublic javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache)
getXMLStreamReader in interface OMContainer
public javax.xml.stream.XMLStreamReader getXMLStreamReader(boolean cache,
OMXMLStreamReaderConfiguration configuration)
getXMLStreamReader in interface OMContainerpublic void setText(java.lang.String text)
setText in interface OMElementpublic void setText(javax.xml.namespace.QName qname)
setText in interface OMElementpublic java.lang.String getText()
getText in interface OMElementpublic java.io.Reader getTextAsStream(boolean cache)
getTextAsStream in interface OMElementpublic javax.xml.namespace.QName getTextAsQName()
getTextAsQName in interface OMElement
public void writeTextTo(java.io.Writer out,
boolean cache)
throws java.io.IOException
writeTextTo in interface OMElementjava.io.IOException
public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
throws javax.xml.stream.XMLStreamException
OMSerializableImpl
internalSerialize in interface OMNodeExinternalSerialize in class OMSerializableImpljavax.xml.stream.XMLStreamExceptionpublic OMElement getFirstElement()
getFirstElement in interface OMElementpublic java.lang.String getLocalName()
getLocalName in interface OMNamedInformationItempublic void setLocalName(java.lang.String localName)
setLocalName in interface OMNamedInformationItempublic OMNamespace getNamespace()
getNamespace in interface OMNamedInformationItempublic java.lang.String getPrefix()
getPrefix in interface OMNamedInformationItempublic java.lang.String getNamespaceURI()
getNamespaceURI in interface OMNamedInformationItempublic void setNamespace(OMNamespace namespace)
setNamespace in interface OMElementpublic void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
setNamespaceWithNoFindInCurrentScope in interface OMElementpublic javax.xml.namespace.QName getQName()
getQName in interface OMNamedInformationItem
public java.lang.String toStringWithConsume()
throws javax.xml.stream.XMLStreamException
toStringWithConsume in interface OMElementjavax.xml.stream.XMLStreamExceptionpublic java.lang.String toString()
toString in interface OMElementtoString in class java.lang.Object
public void discard()
throws OMException
discard in interface OMNodeOMExceptionpublic javax.xml.namespace.QName resolveQName(java.lang.String qname)
resolveQName in interface OMElementpublic OMElement cloneOMElement()
cloneOMElement in interface OMElement
protected OMElement createClone(OMCloneOptions options,
OMContainer targetParent)
public void setLineNumber(int lineNumber)
setLineNumber in interface OMElementpublic int getLineNumber()
getLineNumber in interface OMElementpublic void buildWithAttachments()
OMNodeImpl
buildWithAttachments in interface OMNodebuildWithAttachments in class OMNodeImplpublic javax.xml.transform.sax.SAXSource getSAXSource(boolean cache)
getSAXSource in interface OMContainerpublic void removeChildren()
removeChildren in interface OMContainer
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||