|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.apache.axis2.om.impl.dom.NodeImpl
org.apache.axis2.om.impl.dom.ChildNode
org.apache.axis2.om.impl.dom.ParentNode
org.apache.axis2.om.impl.dom.ElementImpl
Implementation of the org.w3c.dom.Element and org.apache.axis2.om.Element interfaces.
| Field Summary | |
protected java.lang.String |
localName
|
protected OMNamespace |
namespace
|
| Fields inherited from class org.apache.axis2.om.impl.dom.ParentNode |
firstChild, lastChild |
| Fields inherited from class org.apache.axis2.om.impl.dom.ChildNode |
nextSibling, parentNode, previousSubling |
| Fields inherited from class org.apache.axis2.om.impl.dom.NodeImpl |
builder, done, FIRSTCHILD, flags, nodeType, NORMALIZED, OWNED, ownerNode, READONLY, SPECIFIED |
| Fields inherited from interface org.w3c.dom.Node |
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE |
| Fields inherited from interface org.apache.axis2.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.axis2.om.OMConstants |
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DEFAULT_CHAR_SET_ENCODING, DEFAULT_XML_VERSION, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI |
| Constructor Summary | |
ElementImpl(DocumentImpl ownerDocument,
java.lang.String tagName)
|
|
ElementImpl(DocumentImpl ownerDocument,
java.lang.String tagName,
NamespaceImpl ns)
Create a new element with the namespace |
|
ElementImpl(DocumentImpl ownerDocument,
java.lang.String tagName,
NamespaceImpl ns,
OMXMLParserWrapper builder)
|
|
ElementImpl(ParentNode parentNode,
java.lang.String tagName,
NamespaceImpl ns)
|
|
ElementImpl(ParentNode parentNode,
java.lang.String tagName,
NamespaceImpl ns,
OMXMLParserWrapper builder)
|
|
ElementImpl(java.lang.String tagName,
NamespaceImpl ns,
OMXMLParserWrapper builder)
|
|
| Method Summary | |
OMAttribute |
addAttribute(OMAttribute attr)
This will add an attribute to this element. |
OMAttribute |
addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace ns)
The behaviour of this is the same as org.w3c.dom.Element#setAttributeNS |
OMElement |
cloneOMElement()
This method will clone this element. |
OMNamespace |
declareNamespace(OMNamespace namespace)
This will allow overriding an existing declaration if the same prefix was used |
OMNamespace |
declareNamespace(java.lang.String uri,
java.lang.String prefix)
This will allow overriding an existing declaration if the same prefix was used |
OMNamespace |
findNamespace(java.lang.String uri,
java.lang.String prefix)
This will find a namespace with the given uri and prefix, in the scope of the hierarchy. |
OMNamespace |
findNamespaceURI(java.lang.String prefix)
This will check for a namespace in the context of this element with the given prefix and will return the relevant namespace object, if available. |
java.util.Iterator |
getAllAttributes()
This will return a List of OMAttributes. |
java.util.Iterator |
getAllDeclaredNamespaces()
Returns an iterator for all of the namespaces declared on this element. |
OMAttribute |
getAttribute(javax.xml.namespace.QName qname)
Returns a named attribute if present. |
java.lang.String |
getAttribute(java.lang.String name)
Look in the local list of attributes and return if found if the local list is null return null |
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 Attr 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()
This will return the set of attributes of this node and the namespace declarations available |
java.lang.String |
getAttributeValue(javax.xml.namespace.QName qname)
Return a named attribute's value, if present. |
OMXMLParserWrapper |
getBuilder()
Returns the builder object. |
java.util.Iterator |
getChildElements()
Returns a filtered list of children - just the elements. |
org.w3c.dom.NodeList |
getElementsByTagName(java.lang.String name)
|
org.w3c.dom.NodeList |
getElementsByTagNameNS(java.lang.String namespaceURI,
java.lang.String localName)
|
OMAttribute |
getFirstAttribute(javax.xml.namespace.QName qname)
Returns the first attribute of the set of attributes if there are any attributes. |
OMElement |
getFirstElement()
Returns the first Element node |
java.lang.String |
getLocalName()
Returns the local name of this element node |
OMNamespace |
getNamespace()
Returns the namespace of this element |
java.lang.String |
getNamespaceURI()
Returns the value of the namespace URI |
java.lang.String |
getNamespaceURI(java.lang.String prefix)
return the namespace uri, given the prefix |
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()
|
java.lang.String |
getTagName()
|
java.lang.String |
getText()
select all the text children and concat them to a single string |
int |
getType()
Returns the type of node. |
javax.xml.stream.XMLStreamReader |
getXMLStreamReader()
Returns the pull parser that will generate the pull events relevant to THIS element. |
javax.xml.stream.XMLStreamReader |
getXMLStreamReaderWithoutCaching()
Returns the pull parser that will generate the pull events relevant to THIS element. |
boolean |
hasAttribute(java.lang.String name)
|
boolean |
hasAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
Returns whether the given attr is available or not |
boolean |
hasAttributes()
Returns whether this element contains any attr or not |
void |
removeAttribute(OMAttribute attr)
Removes an attribute fron the element |
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)
|
boolean |
removeNamespace(java.lang.String prefix)
Remove a declared namespace give its prefix |
javax.xml.namespace.QName |
resolveQName(java.lang.String qname)
Turn a prefix:local qname string into a proper QName, evaluating it in the OMElement context unprefixed qnames resolve to the local namespace |
void |
serialize(OMOutputImpl omOutput)
Serialize the node with caching |
protected void |
serialize(OMOutputImpl omOutput,
boolean cache)
|
void |
serializeAndConsume(OMOutputImpl omOutput)
Serialize the node without caching |
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 |
setIdAttribute(java.lang.String arg0,
boolean arg1)
|
void |
setIdAttributeNode(org.w3c.dom.Attr arg0,
boolean arg1)
|
void |
setIdAttributeNS(java.lang.String arg0,
java.lang.String arg1,
boolean arg2)
|
void |
setLocalName(java.lang.String localName)
Set the local name |
void |
setNamespace(OMNamespace namespace)
Set the namespace |
protected void |
setOwnerDocument(DocumentImpl document)
sets the owner document |
void |
setText(java.lang.String text)
Creates a text node with the given value and adds it to the element |
void |
setType(int nodeType)
|
java.lang.String |
toString()
Overridden toString() for ease of debuging |
java.lang.String |
toStringWithConsume()
This is a convenience method only. |
| Methods inherited from class org.apache.axis2.om.impl.dom.ParentNode |
addChild, buildNext, getChildNodes, getChildren, getChildrenWithName, getFirstChild, getFirstChildWithName, getFirstOMChild, getLastChild, hasChildNodes, insertBefore, removeChild, replaceChild, setFirstChild |
| Methods inherited from class org.apache.axis2.om.impl.dom.ChildNode |
detach, discard, getNextOMSibling, getNextSibling, getParent, getParentNode, getPreviousOMSibling, getPreviousSibling, insertSiblingAfter, insertSiblingBefore, setNextOMSibling, setParent, setPreviousOMSibling |
| Methods inherited from class org.apache.axis2.om.impl.dom.NodeImpl |
appendChild, build, cloneNode, compareDocumentPosition, getBaseURI, getFeature, getLength, getNodeValue, getOwnerDocument, getTextContent, getUserData, isComplete, isDefaultNamespace, isEqualNode, isSameNode, isSupported, item, lookupNamespaceURI, lookupPrefix, normalize, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeWithCache, setComplete, setNodeValue, setPrefix, setTextContent, setUserData |
| 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, getChildNodes, getFirstChild, getLastChild, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPreviousSibling, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
| Methods inherited from interface org.apache.axis2.om.OMElement |
setFirstChild |
| Methods inherited from interface org.apache.axis2.om.OMNode |
build, detach, discard, getNextOMSibling, getParent, getPreviousOMSibling, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume |
| Methods inherited from interface org.apache.axis2.om.OMContainer |
addChild, buildNext, getChildren, getChildrenWithName, getFirstChildWithName, getFirstOMChild, isComplete |
| Methods inherited from interface org.apache.axis2.om.impl.OMContainerEx |
setComplete |
| Field Detail |
protected OMNamespace namespace
protected java.lang.String localName
| Constructor Detail |
public ElementImpl(DocumentImpl ownerDocument,
java.lang.String tagName)
ownerDocument -
public ElementImpl(DocumentImpl ownerDocument,
java.lang.String tagName,
NamespaceImpl ns)
ownerDocument - tagName - ns -
public ElementImpl(DocumentImpl ownerDocument,
java.lang.String tagName,
NamespaceImpl ns,
OMXMLParserWrapper builder)
public ElementImpl(ParentNode parentNode,
java.lang.String tagName,
NamespaceImpl ns)
public ElementImpl(ParentNode parentNode,
java.lang.String tagName,
NamespaceImpl ns,
OMXMLParserWrapper builder)
public ElementImpl(java.lang.String tagName,
NamespaceImpl ns,
OMXMLParserWrapper builder)
| 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 org.w3c.dom.NodegetNamespaceURI in class NodeImpl
public int getType()
throws OMException
OMNode
getType in interface OMNodeOMNode.ELEMENT_NODE, OMNode.TEXT_NODE, OMNode.CDATA_SECTION_NODE, OMNode.COMMENT_NODE,
OMNode.DTD_NODE, OMNode.PI_NODE, OMNode.ENTITY_REFERENCE_NODE, OMNode.SPACE_NODE,
or OMNode.TEXT_NODE.
OMException
public void setType(int nodeType)
throws OMException
setType in interface OMNodeExOMExceptionpublic 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(java.lang.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(java.lang.String, java.lang.String)public java.lang.String getAttribute(java.lang.String name)
getAttribute in interface org.w3c.dom.ElementElement.getAttribute(java.lang.String)public org.w3c.dom.Attr getAttributeNode(java.lang.String name)
getAttributeNode in interface org.w3c.dom.ElementElement.getAttributeNode(java.lang.String)
public java.lang.String getAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
getAttributeNS in interface org.w3c.dom.ElementElement.getAttributeNS(java.lang.String, java.lang.String)
public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI,
java.lang.String localName)
getAttributeNodeNS in interface org.w3c.dom.ElementElement.getAttributeNodeNS(java.lang.String, java.lang.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(java.lang.String, java.lang.String, java.lang.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)
OMElementThere is no order implied by added attributes.
addAttribute in interface OMElementattr - The attribute to add.
OMElement.addAttribute(org.apache.axis2.om.OMAttribute)
public OMAttribute addAttribute(java.lang.String attributeName,
java.lang.String value,
OMNamespace ns)
addAttribute in interface OMElementattributeName - The "local name" for the attribute.value - The string value of the attribute.ns - The namespace has to be one of the in scope namespace. i.e. the passed namespace
must be declared in the parent element of this attribute or ancestors of the parent element of the attribute.
OMElement.addAttribute(java.lang.String, java.lang.String, org.apache.axis2.om.OMNamespace)public OMNamespace declareNamespace(OMNamespace namespace)
declareNamespace in interface OMElementnamespace - The namespace to declare
OMElement.declareNamespace(org.apache.axis2.om.OMNamespace)
public OMNamespace declareNamespace(java.lang.String uri,
java.lang.String prefix)
declareNamespace in interface OMElementuri - The namespace to declare in the current scope. The
caller is expected to ensure that the URI is a valid namespace name.prefix - The prefix to associate with the given namespace.
The caller is expected to ensure that this is a valid XML prefix.
OMElement.declareNamespace(java.lang.String, java.lang.String)
public OMNamespace findNamespace(java.lang.String uri,
java.lang.String prefix)
OMElementThis will search from the current element and go up the hiararchy until a match is found. If no match is found, return null.
Either prefix or uri should be null. Results are undefined if both are specified.
findNamespace in interface OMElementuri - The namespace to look for. If this is specified, prefix should be null.prefix - The prefix to look for. If this is specified, uri should be null.
OMElement.findNamespace(java.lang.String, java.lang.String)public OMNamespace findNamespaceURI(java.lang.String prefix)
OMElement
findNamespaceURI in interface OMElementprefix - public OMAttribute getAttribute(javax.xml.namespace.QName qname)
getAttribute in interface OMElementqname - the qualified name to search for
OMElement.getAttribute(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 OMXMLParserWrapper getBuilder()
OMElement
getBuilder in interface OMElementpublic OMAttribute getFirstAttribute(javax.xml.namespace.QName qname)
getFirstAttribute in interface OMElementqname - The attribute name to match.
OMElement.getFirstAttribute(javax.xml.namespace.QName)public OMElement getFirstElement()
getFirstElement in interface OMElementOMElement.getFirstElement()
public OMNamespace getNamespace()
throws OMException
getNamespace in interface OMElementOMExceptionOMElement.getNamespace()public javax.xml.namespace.QName getQName()
getQName in interface OMElementQName for the element.OMElement.getQName()public java.lang.String getText()
getText in interface OMElementOMElement.getText()public void removeAttribute(OMAttribute attr)
removeAttribute in interface OMElementattr - OMElement.removeAttribute(org.apache.axis2.om.OMAttribute)public void setBuilder(OMXMLParserWrapper wrapper)
setBuilder in interface OMElementwrapper - OMElement.setBuilder(org.apache.axis2.om.OMXMLParserWrapper)public void setLocalName(java.lang.String localName)
setLocalName in interface OMElementlocalName - OMElement.setLocalName(java.lang.String)public void setNamespace(OMNamespace namespace)
setNamespace in interface OMElementnamespace - OMElement.setNamespace(org.apache.axis2.om.OMNamespace)public void setText(java.lang.String text)
setText in interface OMElementtext - OMElement.setText(java.lang.String)
public void serialize(OMOutputImpl omOutput)
throws javax.xml.stream.XMLStreamException
OMNodeEx
serialize in interface OMNodeExomOutput -
javax.xml.stream.XMLStreamExceptionOMNodeEx.serialize(org.apache.axis2.om.impl.OMOutputImpl)
public void serializeAndConsume(OMOutputImpl omOutput)
throws javax.xml.stream.XMLStreamException
OMNodeEx
serializeAndConsume in interface OMNodeExomOutput -
javax.xml.stream.XMLStreamException
protected void serialize(OMOutputImpl omOutput,
boolean cache)
throws javax.xml.stream.XMLStreamException
javax.xml.stream.XMLStreamExceptionpublic javax.xml.stream.XMLStreamReader getXMLStreamReaderWithoutCaching()
OMElementCaching is off.
getXMLStreamReaderWithoutCaching in interface OMElementpublic javax.xml.stream.XMLStreamReader getXMLStreamReader()
OMElementCaching is on.
getXMLStreamReader in interface OMElement
public java.lang.String toStringWithConsume()
throws javax.xml.stream.XMLStreamException
OMElement
toStringWithConsume in interface OMElementjavax.xml.stream.XMLStreamExceptionpublic java.lang.String toString()
toString in interface OMElementObject.toString()public java.util.Iterator getChildElements()
OMElement
getChildElements in interface OMElementOMContainer.getChildren(),
OMContainer.getChildrenWithName(javax.xml.namespace.QName)
public java.util.Iterator getAllDeclaredNamespaces()
throws OMException
OMElementIf you're interested in all namespaces in scope, you need to call this function for all parent elements as well. Note that the iterator may be invalidated by any call to either declareNamespace function.
getAllDeclaredNamespaces in interface OMElementOMNamespace items declared on the current element.
OMExceptionOMElement.getAllDeclaredNamespaces()public java.util.Iterator getAllAttributes()
OMElementNote that the iterator returned by this function will be invalidated by any addAttribute call.
getAllAttributes in interface OMElementIterator of OMAttribute items associated with the element.OMElement.getAllAttributes()public java.lang.String getLocalName()
getLocalName in interface org.w3c.dom.NodegetLocalName in class NodeImplNode.getLocalName()public java.lang.String getPrefix()
getPrefix in interface org.w3c.dom.NodegetPrefix in class NodeImplNode.getPrefix()protected void setOwnerDocument(DocumentImpl document)
NodeImpl
setOwnerDocument in class NodeImpldocument - NodeImpl.setOwnerDocument(org.apache.axis2.om.impl.dom.DocumentImpl)public javax.xml.namespace.QName resolveQName(java.lang.String qname)
resolveQName in interface OMElementqname - prefixed qname string to resolve
public OMElement cloneOMElement()
OMElement
cloneOMElement 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 boolean removeNamespace(java.lang.String prefix)
prefix -
public org.w3c.dom.TypeInfo getSchemaTypeInfo()
public void setIdAttribute(java.lang.String arg0,
boolean arg1)
throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
public void setIdAttributeNode(org.w3c.dom.Attr arg0,
boolean arg1)
throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
public void setIdAttributeNS(java.lang.String arg0,
java.lang.String arg1,
boolean arg2)
throws org.w3c.dom.DOMException
org.w3c.dom.DOMException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||