com.gargoylesoftware.htmlunit.html
Class DomComment

java.lang.Object
  extended by com.gargoylesoftware.htmlunit.html.DomNode
      extended by com.gargoylesoftware.htmlunit.html.DomCharacterData
          extended by com.gargoylesoftware.htmlunit.html.DomComment
All Implemented Interfaces:
Serializable, Cloneable

public class DomComment
extends DomCharacterData

Wrapper for the DOM node Comment.

Version:
$Revision: 2132 $
Author:
Karel Kolman, Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.gargoylesoftware.htmlunit.html.DomNode
DomNode.ChildIterator, DomNode.DescendantElementsIterator
 
Field Summary
static String NODE_NAME
          the symbolic node name
 
Fields inherited from class com.gargoylesoftware.htmlunit.html.DomNode
ATTRIBUTE_NODE, COMMENT_NODE, DOCUMENT_NODE, ELEMENT_NODE, PROPERTY_ELEMENT, READY_STATE_COMPLETE, READY_STATE_INTERACTIVE, READY_STATE_LOADED, READY_STATE_LOADING, READY_STATE_UNINITIALIZED, TEXT_NODE
 
Constructor Summary
DomComment(Page page, String data)
          Create an instance of DomComment
 
Method Summary
 String asText()
          Returns a text representation of this element that represents what would be visible to the user if this page was shown in a web browser.
 String getNodeName()
          Get the name for the current node.
 short getNodeType()
          Get the type of the current node.
protected  void printXml(String indent, PrintWriter printWriter)
          recursively write the XML data for the node tree starting at node
 String toString()
          Gives a simple representation to facilitate debugging
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomCharacterData
appendData, deleteData, getData, getLength, getNodeValue, insertData, replaceData, setData, setNodeValue, substringData
 
Methods inherited from class com.gargoylesoftware.htmlunit.html.DomNode
addDomChangeListener, addPropertyChangeListener, appendChild, appendDomChild, asXml, cloneDomNode, cloneNode, fireNodeAdded, fireNodeDeleted, firePropertyChange, getAllHtmlChildElements, getByXPath, getChildIterator, getChildrenAsText, getEndColumnNumber, getEndLineNumber, getEventHandler, getFirstByXPath, getFirstChild, getFirstDomChild, getLastChild, getLastDomChild, getLocalName, getLog, getNamespaceURI, getNativePage, getNextDomSibling, getNextSibling, getPage, getParentDomNode, getParentNode, getPrefix, getPreviousDomSibling, getPreviousSibling, getReadyState, getScriptObject, getStartColumnNumber, getStartLineNumber, hasAttributes, insertBefore, isAncestorOf, isRenderedVisible, isTrimmedText, notifyIncorrectness, onAddedToPage, onAllChildrenAddedToPage, printChildrenAsXml, reduceWhitespace, remove, removeAllChildren, removeDomChangeListener, removeEventHandler, removePropertyChangeListener, replace, setEventHandler, setEventHandler, setNextSibling, setParentNode, setPrefix, setPreviousSibling, setReadyState, setScriptObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NODE_NAME

public static final String NODE_NAME
the symbolic node name

See Also:
Constant Field Values
Constructor Detail

DomComment

public DomComment(Page page,
                  String data)
Create an instance of DomComment

Parameters:
page - The Page that contains this element.
data - the string data held by this node
Method Detail

getNodeType

public short getNodeType()
Description copied from class: DomNode
Get the type of the current node.

Specified by:
getNodeType in class DomNode
Returns:
the node type constant, in this case Node.COMMENT_NODE

getNodeName

public String getNodeName()
Description copied from class: DomNode
Get the name for the current node.

Specified by:
getNodeName in class DomNode
Returns:
the node name, in this case NODE_NAME

asText

public String asText()
Returns a text representation of this element that represents what would be visible to the user if this page was shown in a web browser. For example, a single-selection select element would return the currently selected value as text.

Overrides:
asText in class DomNode
Returns:
The element as text.

printXml

protected void printXml(String indent,
                        PrintWriter printWriter)
recursively write the XML data for the node tree starting at node

Overrides:
printXml in class DomNode
Parameters:
indent - white space to indent child nodes
printWriter - writer where child nodes are written

toString

public String toString()
Gives a simple representation to facilitate debugging

Overrides:
toString in class Object
Returns:
a simple representation


Copyright © 2002-2010 Gargoyle Software Inc.. All Rights Reserved.