|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.xerces.impl.xs.opti.DefaultNode org.apache.xerces.impl.xs.opti.NodeImpl org.apache.xerces.impl.xs.opti.DefaultElement org.apache.xerces.impl.xs.opti.ElementImpl
public class ElementImpl
Field Summary |
---|
Constructor Summary | |
---|---|
ElementImpl(int line,
int column)
|
|
ElementImpl(int line,
int column,
int offset)
|
|
ElementImpl(java.lang.String prefix,
java.lang.String localpart,
java.lang.String rawname,
java.lang.String uri,
int line,
int column)
|
|
ElementImpl(java.lang.String prefix,
java.lang.String localpart,
java.lang.String rawname,
java.lang.String uri,
int line,
int column,
int offset)
|
Method Summary | |
---|---|
java.lang.String |
getAnnotation()
|
java.lang.String |
getAttribute(java.lang.String name)
Retrieves an attribute value by name. |
Attr |
getAttributeNode(java.lang.String name)
Retrieves an attribute node by name. |
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. |
NamedNodeMap |
getAttributes()
A NamedNodeMap containing the attributes of this node (if
it is an Element ) or null otherwise. |
int |
getCharacterOffset()
Returns the character offset. |
int |
getColumnNumber()
Returns the column number. |
Node |
getFirstChild()
The first child of this node. |
Node |
getLastChild()
The last child of this node. |
int |
getLineNumber()
Returns the line number. |
Node |
getNextSibling()
The node immediately following this node. |
Document |
getOwnerDocument()
The Document object associated with this node. |
Node |
getParentNode()
The parent of this node. |
Node |
getPreviousSibling()
The node immediately preceding this node. |
java.lang.String |
getSyntheticAnnotation()
|
java.lang.String |
getTagName()
The name of the element. |
boolean |
hasAttribute(java.lang.String name)
Returns true when an attribute with a given name is
specified on this element or has a default value, false
otherwise. |
boolean |
hasAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
Returns true when an attribute with a given local name and
namespace URI is specified on this element or has a default value,
false otherwise. |
boolean |
hasAttributes()
Returns whether this node (if it is an element) has any attributes. |
boolean |
hasChildNodes()
Returns whether this node has any children. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Adds a new attribute. |
Methods inherited from class org.apache.xerces.impl.xs.opti.DefaultElement |
---|
getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, removeAttribute, removeAttributeNode, removeAttributeNS, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS |
Methods inherited from class org.apache.xerces.impl.xs.opti.NodeImpl |
---|
getLocalName, getNamespaceURI, getNodeName, getNodeType, getPrefix, getReadOnly, setReadOnly |
Methods inherited from class org.apache.xerces.impl.xs.opti.DefaultNode |
---|
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getNodeValue, getTextContent, getUserData, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, cloneNode, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getLocalName, getNamespaceURI, getNodeName, getNodeType, getNodeValue, getPrefix, getTextContent, getUserData, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Constructor Detail |
---|
public ElementImpl(int line, int column, int offset)
public ElementImpl(int line, int column)
public ElementImpl(java.lang.String prefix, java.lang.String localpart, java.lang.String rawname, java.lang.String uri, int line, int column, int offset)
public ElementImpl(java.lang.String prefix, java.lang.String localpart, java.lang.String rawname, java.lang.String uri, int line, int column)
Method Detail |
---|
public Document getOwnerDocument()
Node
Document
object associated with this node. This is
also the Document
object used to create new nodes. When
this node is a Document
or a DocumentType
which is not used with any Document
yet, this is
null
.
getOwnerDocument
in interface Node
getOwnerDocument
in class DefaultNode
public Node getParentNode()
Node
Attr
,
Document
, DocumentFragment
,
Entity
, and Notation
may have a parent.
However, if a node has just been created and not yet added to the
tree, or if it has been removed from the tree, this is
null
.
getParentNode
in interface Node
getParentNode
in class DefaultNode
public boolean hasChildNodes()
Node
hasChildNodes
in interface Node
hasChildNodes
in class DefaultNode
true
if this node has any children,
false
otherwise.public Node getFirstChild()
Node
null
.
getFirstChild
in interface Node
getFirstChild
in class DefaultNode
public Node getLastChild()
Node
null
.
getLastChild
in interface Node
getLastChild
in class DefaultNode
public Node getPreviousSibling()
Node
null
.
getPreviousSibling
in interface Node
getPreviousSibling
in class DefaultNode
public Node getNextSibling()
Node
null
.
getNextSibling
in interface Node
getNextSibling
in class DefaultNode
public NamedNodeMap getAttributes()
Node
NamedNodeMap
containing the attributes of this node (if
it is an Element
) or null
otherwise.
getAttributes
in interface Node
getAttributes
in class DefaultNode
public boolean hasAttributes()
Node
hasAttributes
in interface Node
hasAttributes
in class DefaultNode
true
if this node has any attributes,
false
otherwise.public java.lang.String getTagName()
Element
Node.localName
is different
from null
, this attribute is a qualified name. For
example, in:
<elementExample id="demo"> ... </elementExample> ,
tagName
has the value
"elementExample"
. Note that this is case-preserving in
XML, as are all of the operations of the DOM. The HTML DOM returns
the tagName
of an HTML element in the canonical
uppercase form, regardless of the case in the source HTML document.
getTagName
in interface Element
getTagName
in class DefaultElement
public java.lang.String getAttribute(java.lang.String name)
Element
getAttribute
in interface Element
getAttribute
in class DefaultElement
name
- The name of the attribute to retrieve.
Attr
value as a string, or the empty string
if that attribute does not have a specified or default value.public Attr getAttributeNode(java.lang.String name)
Element
getAttributeNodeNS
method.
getAttributeNode
in interface Element
getAttributeNode
in class DefaultElement
name
- The name (nodeName
) of the attribute to
retrieve.
Attr
node with the specified name (
nodeName
) or null
if there is no such
attribute.public java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
Element
null
as the
namespaceURI
parameter for methods if they wish to have
no namespace.
getAttributeNS
in interface Element
getAttributeNS
in class DefaultElement
namespaceURI
- The namespace URI of the attribute to retrieve.localName
- The local name of the attribute to retrieve.
Attr
value as a string, or the empty string
if that attribute does not have a specified or default value.public Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
Element
Attr
node by local name and namespace URI.
null
as the
namespaceURI
parameter for methods if they wish to have
no namespace.
getAttributeNodeNS
in interface Element
getAttributeNodeNS
in class DefaultElement
namespaceURI
- The namespace URI of the attribute to retrieve.localName
- The local name of the attribute to retrieve.
Attr
node with the specified attribute local
name and namespace URI or null
if there is no such
attribute.public boolean hasAttribute(java.lang.String name)
Element
true
when an attribute with a given name is
specified on this element or has a default value, false
otherwise.
hasAttribute
in interface Element
hasAttribute
in class DefaultElement
name
- The name of the attribute to look for.
true
if an attribute with the given name is
specified on this element or has a default value, false
otherwise.public boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
Element
true
when an attribute with a given local name and
namespace URI is specified on this element or has a default value,
false
otherwise.
null
as the
namespaceURI
parameter for methods if they wish to have
no namespace.
hasAttributeNS
in interface Element
hasAttributeNS
in class DefaultElement
namespaceURI
- The namespace URI of the attribute to look for.localName
- The local name of the attribute to look for.
true
if an attribute with the given local name
and namespace URI is specified or has a default value on this
element, false
otherwise.public void setAttribute(java.lang.String name, java.lang.String value)
Element
Attr
node plus any
Text
and EntityReference
nodes, build the
appropriate subtree, and use setAttributeNode
to assign
it as the value of an attribute.
setAttributeNS
method.
setAttribute
in interface Element
setAttribute
in class DefaultElement
name
- The name of the attribute to create or alter.value
- Value to set in string form.public int getLineNumber()
public int getColumnNumber()
public int getCharacterOffset()
public java.lang.String getAnnotation()
public java.lang.String getSyntheticAnnotation()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |