|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.gargoylesoftware.htmlunit.html.DomNode
com.gargoylesoftware.htmlunit.html.DomNamespaceNode
com.gargoylesoftware.htmlunit.html.DomElement
public class DomElement
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
---|
DomNode.ChildIterator, DomNode.DescendantElementsIterator<T extends DomNode> |
Field Summary | |
---|---|
static String |
ATTRIBUTE_NOT_DEFINED
Constant meaning that the specified attribute was not defined. |
static String |
ATTRIBUTE_VALUE_EMPTY
Constant meaning that the specified attribute was found but its value was empty. |
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode |
---|
AS_TEXT_BLANK, AS_TEXT_BLOCK_SEPARATOR, AS_TEXT_NEW_LINE, AS_TEXT_TAB, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED |
Constructor Summary | |
---|---|
DomElement(String namespaceURI,
String qualifiedName,
SgmlPage page,
Map<String,DomAttr> attributes)
Creates an instance of a DOM element that can have a namespace. |
Method Summary | |
---|---|
DomNode |
cloneNode(boolean deep)
|
String |
getAttribute(String attributeName)
Returns the value of the attribute specified by name or an empty string. |
DomAttr |
getAttributeNode(String name)
|
DomAttr |
getAttributeNodeNS(String namespaceURI,
String localName)
|
String |
getAttributeNS(String namespaceURI,
String localName)
Returns the value of the attribute specified by namespace and local name or an empty string. |
NamedNodeMap |
getAttributes()
|
Map<String,DomAttr> |
getAttributesMap()
Returns the map holding the attributes, keyed by name. |
DomNodeList<HtmlElement> |
getElementsByTagName(String tagName)
|
DomNodeList<HtmlElement> |
getElementsByTagNameNS(String namespace,
String localName)
Not yet implemented. |
String |
getNodeName()
Returns this node's node name. |
short |
getNodeType()
Returns this node's node type. |
TypeInfo |
getSchemaTypeInfo()
Not yet implemented. |
String |
getTagName()
Returns the tag name of this element. |
boolean |
hasAttribute(String attributeName)
Returns whether the attribute specified by name has a value. |
boolean |
hasAttributeNS(String namespaceURI,
String localName)
Returns whether the attribute specified by namespace and local name has a value. |
boolean |
hasAttributes()
|
protected boolean |
isAttributeCaseSensitive()
Indicates if the attribute names are case sensitive. |
protected boolean |
isEmptyXmlTagExpanded()
Indicates if a node without children should be written in expanded form as XML (i.e. |
protected Map<String,String> |
namespaces()
Returns namespaces. |
protected void |
printOpeningTagContentAsXml(PrintWriter printWriter)
Prints the content between "<" and ">" (or "/>") in the output of the tag name and its attributes in XML format. |
protected void |
printXml(String indent,
PrintWriter printWriter)
Recursively write the XML data for the node tree starting at node . |
void |
removeAttribute(String attributeName)
Removes an attribute specified by name from this element. |
Attr |
removeAttributeNode(Attr attribute)
Not yet implemented. |
void |
removeAttributeNS(String namespaceURI,
String localName)
Removes an attribute specified by namespace and local name from this element. |
void |
setAttribute(String attributeName,
String attributeValue)
Sets the value of the attribute specified by name. |
Attr |
setAttributeNode(Attr attribute)
|
Attr |
setAttributeNodeNS(Attr attribute)
Not yet implemented. |
void |
setAttributeNS(String namespaceURI,
String qualifiedName,
String attributeValue)
Sets the value of the attribute specified by namespace and qualified name. |
void |
setIdAttribute(String name,
boolean isId)
Not yet implemented. |
void |
setIdAttributeNode(Attr idAttr,
boolean isId)
Not yet implemented. |
void |
setIdAttributeNS(String namespaceURI,
String localName,
boolean isId)
Not yet implemented. |
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNamespaceNode |
---|
getLocalName, getNamespaceURI, getPrefix, getQualifiedName, setPrefix |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.w3c.dom.Node |
---|
appendChild, compareDocumentPosition, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData |
Field Detail |
---|
public static final String ATTRIBUTE_NOT_DEFINED
public static final String ATTRIBUTE_VALUE_EMPTY
Constructor Detail |
---|
public DomElement(String namespaceURI, String qualifiedName, SgmlPage page, Map<String,DomAttr> attributes)
namespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name of the element type to instantiatepage
- the page that contains this elementattributes
- a map ready initialized with the attributes for this element, or
null
. The map will be stored as is, not copied.Method Detail |
---|
public String getNodeName()
getNodeName
in interface Node
getNodeName
in class DomNode
public final short getNodeType()
getNodeType
in interface Node
getNodeType
in class DomNode
protected Map<String,String> namespaces()
public final String getTagName()
getTagName
in interface Element
public final boolean hasAttributes()
hasAttributes
in interface Node
hasAttributes
in class DomNode
public boolean hasAttribute(String attributeName)
hasAttribute
in interface Element
attributeName
- the name of the attribute
protected void printOpeningTagContentAsXml(PrintWriter printWriter)
printWriter
- the writer to print inprotected void printXml(String indent, PrintWriter printWriter)
node
.
printXml
in class DomNode
indent
- white space to indent child nodesprintWriter
- writer where child nodes are writtenprotected boolean isEmptyXmlTagExpanded()
false
by defaultpublic String getAttribute(String attributeName)
ATTRIBUTE_NOT_DEFINED
if the attribute wasn't specified or ATTRIBUTE_VALUE_EMPTY
if the
attribute was specified but it was empty.
getAttribute
in interface Element
attributeName
- the name of the attribute
ATTRIBUTE_NOT_DEFINED
or ATTRIBUTE_VALUE_EMPTY
public void removeAttribute(String attributeName)
removeAttribute
in interface Element
attributeName
- the attribute attributeNamepublic final void removeAttributeNS(String namespaceURI, String localName)
removeAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacelocalName
- the name within the namespacepublic final Attr removeAttributeNode(Attr attribute)
removeAttributeNode
in interface Element
public final boolean hasAttributeNS(String namespaceURI, String localName)
hasAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacelocalName
- the name within the namespace
public final Map<String,DomAttr> getAttributesMap()
public NamedNodeMap getAttributes()
getAttributes
in interface Node
getAttributes
in class DomNode
public final void setAttribute(String attributeName, String attributeValue)
setAttribute
in interface Element
attributeName
- the name of the attributeattributeValue
- the value of the attributepublic void setAttributeNS(String namespaceURI, String qualifiedName, String attributeValue)
setAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacequalifiedName
- the qualified name (prefix:local) of the attributeattributeValue
- the value of the attributeprotected boolean isAttributeCaseSensitive()
true
public final String getAttributeNS(String namespaceURI, String localName)
ATTRIBUTE_NOT_DEFINED
if the attribute wasn't specified or ATTRIBUTE_VALUE_EMPTY
if the
attribute was specified but it was empty.
getAttributeNS
in interface Element
namespaceURI
- the URI that identifies an XML namespacelocalName
- the name within the namespace
ATTRIBUTE_NOT_DEFINED
or ATTRIBUTE_VALUE_EMPTY
public DomAttr getAttributeNode(String name)
getAttributeNode
in interface Element
public DomAttr getAttributeNodeNS(String namespaceURI, String localName)
getAttributeNodeNS
in interface Element
public DomNodeList<HtmlElement> getElementsByTagName(String tagName)
getElementsByTagName
in interface Element
public DomNodeList<HtmlElement> getElementsByTagNameNS(String namespace, String localName)
getElementsByTagNameNS
in interface Element
public TypeInfo getSchemaTypeInfo()
getSchemaTypeInfo
in interface Element
public void setIdAttribute(String name, boolean isId)
setIdAttribute
in interface Element
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId)
setIdAttributeNS
in interface Element
public Attr setAttributeNode(Attr attribute)
setAttributeNode
in interface Element
public Attr setAttributeNodeNS(Attr attribute)
setAttributeNodeNS
in interface Element
public final void setIdAttributeNode(Attr idAttr, boolean isId)
setIdAttributeNode
in interface Element
public DomNode cloneNode(boolean deep)
cloneNode
in interface Node
cloneNode
in class DomNode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |