|
Xindice API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xindice.xml.dom.NodeImpl | +--org.apache.xindice.xml.dom.ContainerNodeImpl | +--org.apache.xindice.xml.dom.ElementImpl
ElementImpl
Fields inherited from class org.apache.xindice.xml.dom.NodeImpl |
EX_DOMSTRING_SIZE, EX_HIERARCHY_REQUEST, EX_INDEX_SIZE, EX_INUSE_ATTRIBUTE, EX_INVALID_STATE, EX_NO_DATA_ALLOWED, EX_NO_MODIFICATION_ALLOWED, EX_NOT_FOUND, EX_WRONG_DOCUMENT, OBJECT_HREF, OBJECT_NS, OBJECT_TYPE, TYPE_APPEND, TYPE_CONTENT, TYPE_INSERT, TYPE_REPLACE, XMLNS_PREFIX |
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 |
Constructor Summary | |
ElementImpl()
|
|
ElementImpl(NodeImpl parentNode,
boolean dirty)
|
|
ElementImpl(NodeImpl parentNode,
byte[] data,
int pos,
int len)
|
|
ElementImpl(NodeImpl parentNode,
java.lang.String nodeName)
|
Method Summary | |
void |
expandSource()
expandSource expands the source into the Node as a namespace and a set of attributes. |
java.lang.String |
getAttribute(java.lang.String name)
Retrieves an attribute value by name. |
org.w3c.dom.Attr |
getAttributeNode(java.lang.String name)
Retrieves an Attr 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()
A NamedNodeMap containing the attributes of this node (if it
is an Element ) or null otherwise. |
short |
getNodeType()
A code representing the type of the underlying object, as defined above. |
short |
getSymbolID()
getSymbolID returns the Symbol ID for the current node. |
java.lang.String |
getTagName()
The name of the element. |
boolean |
hasAttribute(java.lang.String name)
|
boolean |
hasAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
|
boolean |
hasAttributes()
|
boolean |
hasAutoLink()
|
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. |
void |
removeAttributeNS(java.lang.String namespaceURI,
java.lang.String localName)
Removes an attribute by local name and namespace URI. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Adds a new attribute. |
org.w3c.dom.Attr |
setAttributeNode(org.w3c.dom.Attr newAttr)
Adds a new attribute. |
org.w3c.dom.Attr |
setAttributeNodeNS(org.w3c.dom.Attr newAttr)
Adds a new attribute. |
void |
setAttributeNS(java.lang.String namespaceURI,
java.lang.String qualifiedName,
java.lang.String value)
Adds a new attribute. |
Methods inherited from class org.apache.xindice.xml.dom.ContainerNodeImpl |
appendChild, getChildNodes, getElementById, getElementsByTagName, getElementsByTagNameNS, getFirstChild, getLastChild, hasChildNodes, insertBefore, normalize, removeChild, replaceChild |
Methods inherited from class org.apache.xindice.xml.dom.NodeImpl |
checkReadOnly, cloneNode, getDataBytes, getDataLen, getDataPos, getKey, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getSource, getUserData, isDefined, isDirty, isLoaded, isSameNode, isSupported, load, lookupDefaultNamespaceURI, lookupNamespacePrefix, lookupNamespaceURI, normalizeNS, setDataBytes, setDataBytes, setDataLen, setDataPos, setDirty, setNodeName, setNodeValue, setParentNode, setPrefix, setSource, setUserData, unload |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Element |
getElementsByTagName, getElementsByTagNameNS |
Methods inherited from interface org.w3c.dom.Node |
appendChild, cloneNode, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix |
Constructor Detail |
public ElementImpl()
public ElementImpl(NodeImpl parentNode, byte[] data, int pos, int len)
public ElementImpl(NodeImpl parentNode, boolean dirty)
public ElementImpl(NodeImpl parentNode, java.lang.String nodeName)
Method Detail |
public boolean hasAutoLink()
public short getSymbolID()
CompressedNode
getSymbolID
in class NodeImpl
org.apache.xindice.xml.dom.CompressedNode
public void expandSource()
DBNode
expandSource
in class NodeImpl
public short getNodeType()
NodeImpl
getNodeType
in interface org.w3c.dom.Node
getNodeType
in class NodeImpl
public org.w3c.dom.NamedNodeMap getAttributes()
NamedNodeMap
containing the attributes of this node (if it
is an Element
) or null
otherwise.getAttributes
in interface org.w3c.dom.Node
getAttributes
in class NodeImpl
public boolean hasAttributes()
hasAttributes
in interface org.w3c.dom.Node
hasAttributes
in class NodeImpl
public boolean hasAttribute(java.lang.String name)
hasAttribute
in interface org.w3c.dom.Element
public void removeAttribute(java.lang.String name) throws org.w3c.dom.DOMException
removeAttribute
in interface org.w3c.dom.Element
name
- The name of the attribute to remove.org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public java.lang.String getTagName()
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 org.w3c.dom.Element
public java.lang.String getAttribute(java.lang.String name)
getAttribute
in interface org.w3c.dom.Element
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 org.w3c.dom.Attr setAttributeNode(org.w3c.dom.Attr newAttr) throws org.w3c.dom.DOMException
setAttributeNode
in interface org.w3c.dom.Element
newAttr
- The Attr
node to add to the attribute list.newAttr
attribute replaces an existing
attribute with the same name, the previously existing
Attr
node is returned, otherwise null
is
returned.org.w3c.dom.DOMException
- WRONG_DOCUMENT_ERR: Raised if newAttr
was created from a
different document than the one that created the element.
newAttr
is already an
attribute of another Element
object. The DOM user must
explicitly clone Attr
nodes to re-use them in other
elements.public void setAttribute(java.lang.String name, java.lang.String value) throws org.w3c.dom.DOMException
Attr
node plus any Text
and
EntityReference
nodes, build the appropriate subtree, and
use setAttributeNode
to assign it as the value of an
attribute.setAttribute
in interface org.w3c.dom.Element
name
- The name of the attribute to create or alter.value
- Value to set in string form.org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified name contains an
invalid character.
public org.w3c.dom.Attr getAttributeNode(java.lang.String name)
Attr
node by name.getAttributeNode
in interface org.w3c.dom.Element
name
- The name of the attribute to retrieve.Attr
node with the specified attribute name or
null
if there is no such attribute.public org.w3c.dom.Attr removeAttributeNode(org.w3c.dom.Attr oldAttr) throws org.w3c.dom.DOMException
removeAttributeNode
in interface org.w3c.dom.Element
oldAttr
- The Attr
node to remove from the attribute
list. If the removed Attr
has a default value it is
immediately replaced.Attr
node that was removed.org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
oldAttr
is not an attribute
of the element.public java.lang.String getAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
getAttributeNS
in interface org.w3c.dom.Element
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 void setAttributeNS(java.lang.String namespaceURI, java.lang.String qualifiedName, java.lang.String value)
qualifiedName
, and its
value is changed to be the value
parameter. This value is
a simple string; it is not parsed as it is being set. So any markup
(such as syntax to be recognized as an entity reference) is treated as
literal text, and needs to be appropriately escaped by the
implementation when it is written out. In order to assign an attribute
value that contains entity references, the user must create an
Attr
node plus any Text
and
EntityReference
nodes, build the appropriate subtree, and
use setAttributeNodeNS
or setAttributeNode
to
assign it as the value of an attribute.
setAttributeNS
in interface org.w3c.dom.Element
namespaceURI
- The namespace URI of the attribute to create or
alter.qualifiedName
- The qualified name of the attribute to create or
alter.value
- The value to set in string form.org.w3c.dom.DOMException
- INVALID_CHARACTER_ERR: Raised if the specified qualified name
contains an illegal character.
qualifiedName
is
malformed, if the qualifiedName
has a prefix and the
namespaceURI
is null
or an empty string,
if the qualifiedName
has a prefix that is "xml" and the
namespaceURI
is different from
"http://www.w3.org/XML/1998/namespace", if the
qualifiedName
has a prefix that is "xmlns" and the
namespaceURI
is different from
"http://www.w3.org/2000/xmlns/", or if the qualifiedName
is "xmlns" and the namespaceURI
is different from
"http://www.w3.org/2000/xmlns/".public void removeAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
removeAttributeNS
in interface org.w3c.dom.Element
namespaceURI
- The namespace URI of the attribute to remove.localName
- The local name of the attribute to remove.org.w3c.dom.DOMException
- NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.public org.w3c.dom.Attr getAttributeNodeNS(java.lang.String namespaceURI, java.lang.String localName)
Attr
node by local name and namespace URI.
HTML-only DOM implementations do not need to implement this method.getAttributeNodeNS
in interface org.w3c.dom.Element
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 org.w3c.dom.Attr setAttributeNodeNS(org.w3c.dom.Attr newAttr)
setAttributeNodeNS
in interface org.w3c.dom.Element
newAttr
- The Attr
node to add to the attribute list.newAttr
attribute replaces an existing
attribute with the same local name and namespace URI , the
replaced Attr
node is returned, otherwise
null
is returned.org.w3c.dom.DOMException
- WRONG_DOCUMENT_ERR: Raised if newAttr
was created from
a different document than the one that created the element.
newAttr
is already
an attribute of another Element
object. The DOM user
must explicitly clone Attr
nodes to re-use them in
other elements.public boolean hasAttributeNS(java.lang.String namespaceURI, java.lang.String localName)
hasAttributeNS
in interface org.w3c.dom.Element
|
Xindice API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |