com.gargoylesoftware.htmlunit.javascript.host
Class Comment

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.Node
              extended by com.gargoylesoftware.htmlunit.javascript.host.CharacterDataImpl
                  extended by com.gargoylesoftware.htmlunit.javascript.host.Comment
All Implemented Interfaces:
Serializable, Cloneable, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public final class Comment
extends CharacterDataImpl

A JavaScript object for a Comment. JavaScript: in IE, Comment is Element, but in FF: Comment is CharacterDataImpl. However, in DOM, Comment is CharacterDataImpl.

Version:
$Revision: 8931 $
Author:
Mirko Friedenhagen, Ahmed Ashour, Frank Danek
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
Comment()
          Creates an instance.
 
Method Summary
 Object getAttribute(String attributeName, Integer flags)
          Returns the value of the specified attribute.
 Object getAttributeNode(String attributeName)
          Gets the attribute node for the specified attribute.
 Object getClassName_js()
          Returns the class defined for this element.
 String getClassName()
          Returns the JavaScript class name.
 Object getDocument()
          Returns the document of this element.
 String getId()
          Returns the element ID.
 String getInnerText()
          Gets the innerText attribute.
 Object getTagName()
          Returns the tag name of this element.
 String getText()
          Returns the text of this element.
 void setInnerText(String value)
          Currently does nothing.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.CharacterDataImpl
appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.host.Node
addEventListener, appendChild, asJavaScriptException, attachEvent, cloneNode, compareDocumentPosition, contains, detachEvent, executeEvent, fireEvent, fireEvent, getAttributes, getBaseName, getChildNodes, getEventHandler, getEventHandlerProp, getFirstChild, getJavaScriptNode, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParent, getParentElement, getParentNode, getPrefix, getPreviousSibling, getTextContent, getXml, hasChildNodes, hasEventHandlers, insertBefore, insertBeforeImpl, isSameNode, normalize, removeChild, removeEventListener, replaceChild, setEventHandler, setEventHandlerProp, setNodeValue, setTextContent
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement, setParentScope
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setPrototype, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Comment

public Comment()
Creates an instance. JavaScript objects must have a default constructor.

Method Detail

getId

public String getId()
Returns the element ID.

Returns:
the ID of this element

getClassName_js

public Object getClassName_js()
Returns the class defined for this element.

Returns:
the class name

getTagName

public Object getTagName()
Returns the tag name of this element.

Returns:
the tag name

getText

public String getText()
Returns the text of this element.

Returns:
the text

getDocument

public Object getDocument()
Returns the document of this element.

Returns:
the document

getAttributeNode

public Object getAttributeNode(String attributeName)
Gets the attribute node for the specified attribute.

Parameters:
attributeName - the name of the attribute to retrieve
Returns:
the attribute node for the specified attribute

getAttribute

public Object getAttribute(String attributeName,
                           Integer flags)
Returns the value of the specified attribute.

Parameters:
attributeName - attribute name
flags - IE-specific flags (see the MSDN documentation for more info)
Returns:
the value of the specified attribute, null if the attribute is not defined
See Also:
MSDN Documentation, IE Bug Documentation

getInnerText

public String getInnerText()
Gets the innerText attribute.

Returns:
the innerText

setInnerText

public void setInnerText(String value)
Currently does nothing.

Parameters:
value - the new value for the contents of this node

getClassName

public String getClassName()
Returns the JavaScript class name.

Specified by:
getClassName in interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
Overrides:
getClassName in class SimpleScriptable
Returns:
the JavaScript class name


Copyright © 2002–2014 Gargoyle Software Inc.. All rights reserved.