|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.axiom.om.impl.dom.NodeImpl
org.apache.axiom.om.impl.dom.ParentNode
org.apache.axiom.om.impl.dom.ElementImpl
public class ElementImpl
Implementation of the org.w3c.dom.Element and org.apache.axiom.om.Element interfaces.
| Field Summary | |
|---|---|
protected OMXMLParserWrapper |
builder
|
protected java.lang.String |
localName
|
protected OMNamespace |
namespace
The namespace of this element. |
protected int |
state
|
| Fields inherited from class org.apache.axiom.om.impl.dom.ParentNode |
|---|
firstChild, lastChild |
| Fields inherited from class org.apache.axiom.om.impl.dom.NodeImpl |
|---|
factory, FIRSTCHILD, flags, HAS_PARENT, SPECIFIED |
| Fields inherited from interface org.w3c.dom.Node |
|---|
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_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.OMNode |
|---|
DTD_NODE, PI_NODE, SPACE_NODE |
| Constructor Summary | |
|---|---|
ElementImpl(ParentNode parentNode,
java.lang.String localName,
OMNamespace ns,
OMXMLParserWrapper builder,
OMFactory factory,
boolean generateNSDecl)
|
|
| Method Summary | |
|---|---|
OMAttribute |
addAttribute(OMAttribute attr)
|
OMAttribute |
addAttribute(java.lang.String localName,
java.lang.String value,
OMNamespace ns)
|
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,
ParentNode targetParent,
boolean generateNSDecl)
|
OMNamespace |
declareDefaultNamespace(java.lang.String uri)
|
OMNamespace |
declareNamespace(OMNamespace namespace)
Allows overriding an existing declaration if the same prefix was used. |
OMNamespace |
declareNamespace(java.lang.String uri,
java.lang.String prefix)
|
void |
discard()
|
void |
discarded()
|
OMNamespace |
findNamespace(java.lang.String uri,
java.lang.String prefix)
|
OMNamespace |
findNamespaceURI(java.lang.String prefix)
|
java.util.Iterator |
getAllAttributes()
|
java.util.Iterator |
getAllDeclaredNamespaces()
|
OMAttribute |
getAttribute(javax.xml.namespace.QName qname)
Returns a named attribute if present. |
java.lang.String |
getAttribute(java.lang.String name)
Looks in the local list of attributes and returns if found. |
org.w3c.dom.Attr |
getAttributeNode(java.lang.String name)
Retrieves an attribute node by name. |
org.w3c.dom.Attr |
getAttributeNodeNS(java.lang.String namespaceURI,
java.lang.String localName)
Retrieves an attribute node by local name and namespace URI. |
java.lang.String |
getAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
Retrieves an attribute value by local name and namespace URI. |
org.w3c.dom.NamedNodeMap |
getAttributes()
Returns the set of attributes of this node and the namespace declarations available. |
java.lang.String |
getAttributeValue(javax.xml.namespace.QName qname)
Returns a named attribute's value, if present. |
OMXMLParserWrapper |
getBuilder()
|
java.util.Iterator |
getChildElements()
|
OMNamespace |
getDefaultNamespace()
|
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String name)
|
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
|
OMElement |
getFirstElement()
Returns the first Element node. |
IParentNode |
getIParentNode()
|
int |
getLineNumber()
|
java.lang.String |
getLocalName()
Returns the local name of this element node |
OMNamespace |
getNamespace()
Returns the namespace of this element. |
javax.xml.namespace.NamespaceContext |
getNamespaceContext(boolean detached)
|
java.util.Iterator |
getNamespacesInScope()
|
java.lang.String |
getNamespaceURI()
Returns the value of the namespace URI. |
java.lang.String |
getNamespaceURI(java.lang.String prefix)
Returns the namespace uri, given the prefix. |
OMNode |
getNextOMSibling()
|
org.w3c.dom.Node |
getNextSibling()
|
java.lang.String |
getNodeName()
|
short |
getNodeType()
|
java.lang.String |
getPrefix()
Returns the namespace prefix of this element node |
javax.xml.namespace.QName |
getQName()
Returns the QName of this element. |
org.w3c.dom.TypeInfo |
getSchemaTypeInfo()
|
int |
getState()
|
java.lang.String |
getTagName()
|
java.lang.String |
getText()
|
javax.xml.namespace.QName |
getTextAsQName()
|
java.io.Reader |
getTextAsStream(boolean cache)
|
int |
getType()
|
boolean |
hasAttribute(java.lang.String name)
|
boolean |
hasAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
Returns whether the given attribute is available or not. |
boolean |
hasAttributes()
Returns whether this element contains any attribute or not. |
void |
internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
|
void |
internalSetNamespace(OMNamespace namespace)
Set the namespace of the node without adding a corresponding namespace declaration. |
boolean |
isComplete()
|
java.lang.String |
lookupNamespaceURI(java.lang.String specifiedPrefix)
|
void |
removeAttribute(OMAttribute attr)
|
void |
removeAttribute(java.lang.String name)
Removes an attribute by name. |
org.w3c.dom.Attr |
removeAttributeNode(org.w3c.dom.Attr oldAttr)
Removes the specified attribute node. |
void |
removeAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
|
void |
removeChildren()
|
javax.xml.namespace.QName |
resolveQName(java.lang.String qname)
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
|
org.w3c.dom.Attr |
setAttributeNode(org.w3c.dom.Attr attr)
Adds a new attribute node. |
org.w3c.dom.Attr |
setAttributeNodeNS(org.w3c.dom.Attr attr)
|
void |
setAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName,
java.lang.String value)
Adds a new attribute. |
void |
setBuilder(OMXMLParserWrapper wrapper)
Sets the OM builder. |
void |
setComplete(boolean complete)
|
void |
setIdAttribute(java.lang.String name,
boolean isId)
|
void |
setIdAttributeNode(org.w3c.dom.Attr idAttr,
boolean isId)
|
void |
setIdAttributeNS(java.lang.String namespaceURI,
java.lang.String localName,
boolean isId)
|
void |
setLineNumber(int lineNumber)
|
void |
setLocalName(java.lang.String localName)
Sets the local name. |
void |
setNamespace(OMNamespace namespace)
|
void |
setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
|
void |
setPrefix(java.lang.String prefix)
|
void |
setText(javax.xml.namespace.QName qname)
|
void |
setText(java.lang.String text)
Creates a text node with the given value and adds it to the element. |
java.lang.String |
toString()
Overridden toString() for ease of debugging. |
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.dom.ParentNode |
|---|
addChild, addChild, appendChild, getChildNodes, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChild, getFirstChildWithName, getFirstOMChild, getFirstOMChildIfAvailable, getLastChild, getLastKnownOMChild, getLength, getSAXSource, getTextContent, getXMLStreamReader, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching, hasChildNodes, insertBefore, item, removeChild, replaceChild, setFirstChild, setLastChild, setTextContent |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.w3c.dom.Node |
|---|
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setTextContent, setUserData |
| 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.IContainer |
|---|
getLastKnownOMChild, setFirstChild, setLastChild |
| Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx |
|---|
addChild |
| Methods inherited from interface org.apache.axiom.om.OMContainer |
|---|
addChild, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDescendants, getFirstChildWithName, getFirstOMChild, getSAXSource, getXMLStreamReader, getXMLStreamReader, getXMLStreamReader, getXMLStreamReaderWithoutCaching |
| Methods inherited from interface org.apache.axiom.om.impl.common.IParentNode |
|---|
getFirstOMChildIfAvailable |
| 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 |
|---|
detach, 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 namespace
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
| Constructor Detail |
|---|
public ElementImpl(ParentNode parentNode,
java.lang.String localName,
OMNamespace ns,
OMXMLParserWrapper builder,
OMFactory factory,
boolean generateNSDecl)
| Method Detail |
|---|
public short getNodeType()
getNodeType in interface org.w3c.dom.Nodepublic java.lang.String getNodeName()
getNodeName in interface org.w3c.dom.Nodepublic java.lang.String getNamespaceURI()
getNamespaceURI in interface OMNamedInformationItemgetNamespaceURI in interface org.w3c.dom.NodegetNamespaceURI in class NodeImpl
public int getType()
throws OMException
getType in interface OMNodeOMExceptionpublic java.lang.String getTagName()
getTagName in interface org.w3c.dom.Element
public void removeAttribute(java.lang.String name)
throws org.w3c.dom.DOMException
removeAttribute in interface org.w3c.dom.Elementname - The name of the attribute to remove
org.w3c.dom.DOMExceptionElement.removeAttribute(String)
public void removeAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
throws org.w3c.dom.DOMException
removeAttributeNS in interface org.w3c.dom.Elementorg.w3c.dom.DOMException
public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr)
throws org.w3c.dom.DOMException
removeAttributeNode in interface org.w3c.dom.Elementorg.w3c.dom.DOMExceptionElement.removeAttributeNode(org.w3c.dom.Attr)public boolean hasAttribute(java.lang.String name)
hasAttribute in interface org.w3c.dom.Element
public boolean hasAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
hasAttributeNS in interface org.w3c.dom.ElementElement.hasAttributeNS(String, String)public java.lang.String getAttribute(java.lang.String name)
getAttribute in interface org.w3c.dom.ElementElement.getAttribute(String)public org.w3c.dom.Attr getAttributeNode(java.lang.String name)
getAttributeNode in interface org.w3c.dom.ElementElement.getAttributeNode(String)
public java.lang.String getAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
getAttributeNS in interface org.w3c.dom.ElementElement.getAttributeNS(String, String)
public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI,
java.lang.String localName)
getAttributeNodeNS in interface org.w3c.dom.ElementElement.getAttributeNodeNS(String, String)
public org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr attr)
throws org.w3c.dom.DOMException
setAttributeNode in interface org.w3c.dom.Elementorg.w3c.dom.DOMExceptionElement.setAttributeNode(org.w3c.dom.Attr)
public void setAttribute(java.lang.String name,
java.lang.String value)
throws org.w3c.dom.DOMException
setAttribute in interface org.w3c.dom.Elementorg.w3c.dom.DOMException
public org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr attr)
throws org.w3c.dom.DOMException
setAttributeNodeNS in interface org.w3c.dom.Elementorg.w3c.dom.DOMException
public void setAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName,
java.lang.String value)
throws org.w3c.dom.DOMException
setAttributeNS in interface org.w3c.dom.Elementorg.w3c.dom.DOMExceptionElement.setAttributeNS(String, String, String)public boolean hasAttributes()
hasAttributes in interface org.w3c.dom.NodehasAttributes in class NodeImpl
public org.w3c.dom.NodeList getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
getElementsByTagNameNS in interface org.w3c.dom.Elementpublic org.w3c.dom.NodeList getElementsByTagName(java.lang.String name)
getElementsByTagName in interface org.w3c.dom.Elementpublic OMAttribute addAttribute(OMAttribute attr)
addAttribute in interface OMElement(org.apache.axiom.om.OMAttribute)
public OMAttribute addAttribute(java.lang.String localName,
java.lang.String value,
OMNamespace ns)
addAttribute 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 OMElement(org.apache.axiom.om.OMNamespace)public void undeclarePrefix(java.lang.String prefix)
undeclarePrefix 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 findNamespace(java.lang.String uri,
java.lang.String prefix)
findNamespace in interface OMElementOMElement.findNamespace(String, String)public OMNamespace findNamespaceURI(java.lang.String prefix)
findNamespaceURI in interface OMElementpublic OMAttribute getAttribute(javax.xml.namespace.QName qname)
getAttribute in interface OMElement(javax.xml.namespace.QName)public java.lang.String getAttributeValue(javax.xml.namespace.QName qname)
getAttributeValue in interface OMElementqname - the qualified name to search for
public OMElement getFirstElement()
getFirstElement in interface OMElementOMElement.getFirstElement()public OMNamespace getNamespace()
getNamespace in interface OMNamedInformationItemOMNamedInformationItem.getNamespace()public javax.xml.namespace.QName getQName()
getQName in interface OMNamedInformationItemOMNamedInformationItem.getQName()public 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.IOExceptionpublic void removeAttribute(OMAttribute attr)
removeAttribute in interface OMElementpublic void setBuilder(OMXMLParserWrapper wrapper)
setBuilder in interface OMElement(org.apache.axiom.om.OMXMLParserWrapper)public void setLocalName(java.lang.String localName)
setLocalName in interface OMNamedInformationItemOMNamedInformationItem.setLocalName(String)public void internalSetNamespace(OMNamespace namespace)
public void setNamespace(OMNamespace namespace)
setNamespace in interface OMElementpublic void setNamespaceWithNoFindInCurrentScope(OMNamespace namespace)
setNamespaceWithNoFindInCurrentScope in interface OMElementpublic void setText(java.lang.String text)
setText in interface OMElementOMElement.setText(String)public void setText(javax.xml.namespace.QName qname)
setText in interface OMElement
public void internalSerialize(javax.xml.stream.XMLStreamWriter writer,
boolean cache)
throws javax.xml.stream.XMLStreamException
internalSerialize in interface OMNodeExinternalSerialize in class NodeImpljavax.xml.stream.XMLStreamException
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.ObjectObject.toString()public java.util.Iterator getChildElements()
getChildElements in interface OMElement
public java.util.Iterator getAllDeclaredNamespaces()
throws OMException
getAllDeclaredNamespaces in interface OMElementOMExceptionOMElement.getAllDeclaredNamespaces()public 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 OMElementOMElement.getAllAttributes()public java.lang.String getLocalName()
getLocalName in interface OMNamedInformationItemgetLocalName in interface org.w3c.dom.NodegetLocalName in class NodeImplNode.getLocalName()public java.lang.String getPrefix()
getPrefix in interface OMNamedInformationItemgetPrefix in interface org.w3c.dom.NodegetPrefix in class NodeImplNode.getPrefix()
public void setPrefix(java.lang.String prefix)
throws org.w3c.dom.DOMException
setPrefix in interface org.w3c.dom.NodesetPrefix in class NodeImplorg.w3c.dom.DOMExceptionpublic javax.xml.namespace.QName resolveQName(java.lang.String qname)
resolveQName in interface OMElementpublic OMElement cloneOMElement()
cloneOMElement in interface OMElement
protected OMElement createClone(OMCloneOptions options,
ParentNode targetParent,
boolean generateNSDecl)
public void setLineNumber(int lineNumber)
setLineNumber in interface OMElementpublic int getLineNumber()
getLineNumber in interface OMElementpublic org.w3c.dom.NamedNodeMap getAttributes()
getAttributes in interface org.w3c.dom.NodegetAttributes in class NodeImplElementImplpublic java.lang.String getNamespaceURI(java.lang.String prefix)
prefix -
public void discard()
throws OMException
discard in interface OMNodeOMException
public void setIdAttribute(java.lang.String name,
boolean isId)
throws org.w3c.dom.DOMException
setIdAttribute in interface org.w3c.dom.Elementorg.w3c.dom.DOMException
public void setIdAttributeNS(java.lang.String namespaceURI,
java.lang.String localName,
boolean isId)
throws org.w3c.dom.DOMException
setIdAttributeNS in interface org.w3c.dom.Elementorg.w3c.dom.DOMException
public void setIdAttributeNode(org.w3c.dom.Attr idAttr,
boolean isId)
throws org.w3c.dom.DOMException
setIdAttributeNode in interface org.w3c.dom.Elementorg.w3c.dom.DOMExceptionpublic org.w3c.dom.TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo in interface org.w3c.dom.Elementpublic void buildWithAttachments()
NodeImpl
buildWithAttachments in interface OMNodebuildWithAttachments in class NodeImplpublic final OMXMLParserWrapper getBuilder()
getBuilder in interface IParentNodegetBuilder in interface OMContainergetBuilder in class NodeImplpublic final int getState()
getState in interface IParentNodepublic final boolean isComplete()
isComplete in interface IParentNodeisComplete in interface OMSerializableisComplete in class NodeImplpublic final void setComplete(boolean complete)
setComplete in interface OMContainerExsetComplete in interface OMNodeExsetComplete in class NodeImplpublic final void discarded()
discarded in interface OMContainerExpublic final void build()
build in interface OMSerializable
public final OMNode getNextOMSibling()
throws OMException
getNextOMSibling in interface OMNodeOMExceptionpublic final org.w3c.dom.Node getNextSibling()
getNextSibling in interface org.w3c.dom.Nodepublic final IParentNode getIParentNode()
getIParentNode in interface IChildNodepublic final void removeChildren()
removeChildren in interface OMContainerpublic final java.lang.String lookupNamespaceURI(java.lang.String specifiedPrefix)
lookupNamespaceURI in interface org.w3c.dom.Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||