Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Application Server XML Java API Reference 10g Release 2 (10.1.2) Part no. B12024-03 September 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.xml.parser.v2
Class XMLComment

    java.lang.Object
      |
      +--oracle.xml.parser.v2.XMLNode
            |
            +--oracle.xml.parser.v2.CharData
                  |
                  +--oracle.xml.parser.v2.XMLComment

All Implemented Interfaces:
  CharacterData, CharacterDataEditVAL, java.lang.Cloneable, Comment, EventTarget, java.io.Externalizable, Node, NodeEditVAL, java.io.Serializable

public class XMLComment
extends oracle.xml.parser.v2.CharData
implements Comment, java.io.Externalizable

This class implements the DOM Comment interface.

See Also:
  `Comment`, `NodeFactory`, `DOMParser.setNodeFactory(oracle.xml.parser.v2.NodeFactory)`, Serialized Form

Field Summary

Fields inherited from class oracle.xml.parser.v2.XMLNode
`ATTRDECL, Auto_Events, capturing, DOMAttrModified, DOMCharacterDataModified, DOMNodeInserted, DOMNodeInsertedIntoDocument, DOMNodeRemoved, DOMNodeRemovedFromDocument, DOMSubtreeModified, ELEMENTDECL, noncapturing, RANGE_DELETE_EVENT, RANGE_DELETETEXT_EVENT, RANGE_INSERT_EVENT, RANGE_INSERTTEXT_EVENT, RANGE_REPLACE_EVENT, RANGE_SETTEXT_EVENT, TRAVERSAL_DELETE_EVENT, TRAVERSAL_REPLACE_EVENT, XMLDECL_NODE`

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`

Fields inherited from interface org.w3c.dom.validation.NodeEditVAL
`VAL_FALSE, VAL_INCOMPLETE, VAL_NS_WF, VAL_SCHEMA, VAL_TRUE, VAL_UNKNOWN, VAL_WF`

Constructor Summary
`XMLComment()` Deprecated. use createComment(String) method of XMLDocument
`XMLComment(java.lang.String text)` Deprecated. use createComment(String) method of XMLDocument

Method Summary
`XMLNode` | `addText(java.lang.String str)` Adds the comment text
`void` | `appendData(java.lang.String arg)` Append the string to the end of the character data of the node.
`short` | `canAppendData(java.lang.String arg)` Determines if data can be appended.
`short` | `canDeleteData(int offset, int count)` Determines if data can be deleted.
`short` | `canInsertData(int offset, java.lang.String arg)` Determines if data can be inserted.
`short` | `canReplaceData(int offset, int count, java.lang.String arg)` Determines if data can be replaced.
`short` | `canSetData(java.lang.String arg)` Determines if data is only whitespace.
`void` | `deleteData(int offset, int count)` Remove a range of characters from the node.
`java.lang.String` | `getData()` Get the character data of this node
`int` | `getLength()` The number of characters that are available through `data` and the `substringData` method below.
`java.lang.String` | `getNodeName()` Gets a name of the node
`short` | `getNodeType()` Gets a code representing the type of the underlying object
`java.lang.String` | `getNodeValue()` Gets the value of this node, depending on its type
`void` | `insertData(int offset, java.lang.String arg)` Insert a string at the specified character offset.
`short` | `isWhitespaceOnly()` Determines if data is only whitespace.
`short` | `nodeValidity(boolean deep, short wFValidityCheckLevel)` Determines if the node is valid relative to the validation type specified in `valType`.
`void` | `readExternal(java.io.ObjectInput inArg)` This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
`void` | `replaceData(int offset, int count, java.lang.String arg)` Replace the characters starting at the specified character offset with the specified string.
`void` | `reportSAXEvents(ContentHandler cntHandler)` Report SAX Events from a DOM Tree
`void` | `setData(java.lang.String data)` Set the character data of this node
`void` | `setNodeValue(java.lang.String nodeValue)` The value of this node, depending on its type overrides method in XMLNode.
`java.lang.String` | `substringData(int offset, int count)` Extracts a range of data from the node.
`void` | `writeExternal(java.io.ObjectOutput outArg)` This method saves the state of the object by creating a binary compressed stream with information about this object.

Methods inherited from class oracle.xml.parser.v2.XMLNode
`addEventListener, addText, appendChild, canAppendChild, canInsertBefore, canRemoveChild, canReplaceChild, cloneNode, dispatchEvent, getAttributes, getChildNodes, getColumnNumber, getDebugMode, getDefaultValue, getEnumeratedValues, getFirstChild, getLastChild, getLineNumber, getLocalName, getNamespaceURI, getNextSibling, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, getPrimitiveTypeId, getProperty, getSystemId, getText, getXMLError, hasAttributes, hasChildNodes, insertBefore, isDocumentFlag, isNodeFlag, isSupported, nodeValidity, normalize, print, print, print, print, removeChild, removeEventListener, replaceChild, resetNodeFlag, selectNodes, selectNodes, selectSingleNode, selectSingleNode, setDebugInfo, setNodeFlag, setNodeFlag, setNodeFlag, setPrefix, setProperty, transformNode, valueOf, valueOf`

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.CharacterData
`appendData, deleteData, getData, getLength, insertData, replaceData, setData, substringData`

Methods inherited from interface org.w3c.dom.Node
`appendChild, cloneNode, getAttributes, getChildNodes, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeValue, getOwnerDocument, getParentNode, getPrefix, getPreviousSibling, hasAttributes, hasChildNodes, insertBefore, isSupported, normalize, removeChild, replaceChild, setNodeValue, setPrefix`

Methods inherited from interface org.w3c.dom.validation.NodeEditVAL
`canAppendChild, canInsertBefore, canRemoveChild, canReplaceChild, getDefaultValue, getEnumeratedValues, nodeValidity`

Constructor Detail

### XMLComment

    public XMLComment()

  Deprecated. use createComment(String) method of XMLDocument
  Default constructor. Note that this constructor is used only during deserialization/decompression of this DOM node. In order to deserialize this node to construct the DOM node from the serialized/ compressed stream, it is required to create a handle of the object.

### XMLComment

    public XMLComment(java.lang.String text)

  Deprecated. use createComment(String) method of XMLDocument
  Creates a new Comment node.
Parameters:
  `text` - Text of the comment node

Method Detail

### getNodeType

    public short getNodeType()

  Gets a code representing the type of the underlying object
  Specified by:
    `getNodeType` in interface `Node`
  Overrides:
    `getNodeType` in class `XMLNode`
  Returns:
    type of the node

### getNodeName

    public java.lang.String getNodeName()

  Gets a name of the node
  Specified by:
    `getNodeName` in interface `Node`
  Overrides:
    `getNodeName` in class `XMLNode`
  Returns:
    name of the node

### addText

    public XMLNode addText(java.lang.String str)

  Adds the comment text
  Parameters:
    `str` - the comment text

### reportSAXEvents

    public void reportSAXEvents(ContentHandler cntHandler)
                         throws SAXException

  Report SAX Events from a DOM Tree
  Overrides:
    `reportSAXEvents` in class `XMLNode`
  Throws:
    `SAXException` - thrown by SAX Callback functions

### canSetData

    public short canSetData(java.lang.String arg)

  Determines if data is only whitespace.
  Specified by:
    `canSetData` in interface `CharacterDataEditVAL`
  Overrides:
    `canSetData` in class `oracle.xml.parser.v2.CharData`
  Parameters:
    `arg` - Argument to be set.
  Returns:
    A validation state constant.

### canAppendData

    public short canAppendData(java.lang.String arg)

  Determines if data can be appended.
  Specified by:
    `canAppendData` in interface `CharacterDataEditVAL`
  Overrides:
    `canAppendData` in class `oracle.xml.parser.v2.CharData`
  Parameters:
    `arg` - Data to be appended.
  Returns:
    A validation state constant.

### canReplaceData

    public short canReplaceData(int offset,
                                int count,
                                java.lang.String arg)
                         throws DOMException

  Determines if data can be replaced.
  Specified by:
    `canReplaceData` in interface `CharacterDataEditVAL`
  Overrides:
    `canReplaceData` in class `oracle.xml.parser.v2.CharData`
  Parameters:
    `offset` - Offset.
    `count` - Replacement.
    `arg` - Argument to be set.
  Returns:
    A validation state constant.
  Throws:
    `DOMException` - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.

### canInsertData

    public short canInsertData(int offset,
                               java.lang.String arg)
                        throws DOMException

  Determines if data can be inserted.
  Specified by:
    `canInsertData` in interface `CharacterDataEditVAL`
  Overrides:
    `canInsertData` in class `oracle.xml.parser.v2.CharData`
  Parameters:
    `offset` - Offset.
    `arg` - Argument to be set.
  Returns:
    A validation state constant.
  Throws:
    `DOMException` - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data.

### canDeleteData

    public short canDeleteData(int offset,
                               int count)
                        throws DOMException

  Determines if data can be deleted.
  Specified by:
    `canDeleteData` in interface `CharacterDataEditVAL`
  Overrides:
    `canDeleteData` in class `oracle.xml.parser.v2.CharData`
  Parameters:
    `offset` - Offset.
    `count` - Number of 16-bit units to delete.
  Returns:
    A validation state constant.
  Throws:
    `DOMException` - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of 16-bit units in data, or if the specified count is negative.

### writeExternal

    public void writeExternal(java.io.ObjectOutput outArg)
                       throws java.io.IOException

  This method saves the state of the object by creating a binary compressed stream with information about this object.
  Specified by:
    `writeExternal` in interface `java.io.Externalizable`
  Overrides:
    `writeExternal` in class `XMLNode`
  Parameters:
    `outArg` - is the ObjectOutput stream used to write the compressed stream.
  Throws:
    `java.io.IOException` - is thrown when there is an exception while writing the compressed stream.

### readExternal

    public void readExternal(java.io.ObjectInput inArg)
                      throws java.io.IOException,
                             java.lang.ClassNotFoundException

  This method reads the information written in the compressed stream by writeExternal method and restores the object correspondingly.
  Specified by:
    `readExternal` in interface `java.io.Externalizable`
  Overrides:
    `readExternal` in class `XMLNode`
  Parameters:
    `inArg` - The ObjectInput stream used for reading the compressed stream
  Throws:
    `java.io.IOException` - is thrown when there is an error in reading the input stream.
    `java.lang.ClassNotFoundException` - is thrown when the class is not found

### getData

    public java.lang.String getData()
                             throws DOMException

  Get the character data of this node
  Specified by:
    `getData` in interface `CharacterData`
  Returns:
    the character data
  Throws:
    `DOMException` - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a `DOMString` variable on the implementation platform.

### setData

    public void setData(java.lang.String data)
                 throws DOMException

  Set the character data of this node
  Specified by:
    `setData` in interface `CharacterData`
  Parameters:
    `data` - the character data to be set
  Throws:
    `DOMException` - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
    `DOMException` - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a `DOMString` variable on the implementation platform.

### getNodeValue

    public java.lang.String getNodeValue()
                                  throws DOMException

  Gets the value of this node, depending on its type
  Specified by:
    `getNodeValue` in interface `Node`
  Overrides:
    `getNodeValue` in class `XMLNode`
  Returns:
    Value of this node
  Throws:
    `DOMException` - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly. DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a `DOMString` variable on the implementation platform.

### setNodeValue

    public void setNodeValue(java.lang.String nodeValue)
                      throws DOMException

  The value of this node, depending on its type overrides method in XMLNode.
  Specified by:
    `setNodeValue` in interface `Node`
  Overrides:
    `setNodeValue` in class `XMLNode`
  Throws:
    `DOMException` - NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
    `DOMException` - DOMSTRING_SIZE_ERR: Raised when it would return more characters than fit in a `DOMString` variable on the implementation platform.

### getLength

    public int getLength()

  The number of characters that are available through `data` and the `substringData` method below. This may have the value zero, i.e., `CharacterData` nodes may be empty.
  Specified by:
    `getLength` in interface `CharacterData`

### substringData

    public java.lang.String substringData(int offset,
                                          int count)
                                   throws DOMException

  Extracts a range of data from the node.
  Specified by:
    `substringData` in interface `CharacterData`
  Parameters:
    `offset` - Start offset of substring to extract.
    `count` - The number of characters to extract.
  Returns:
    The specified substring. If the sum of `offset` and `count` exceeds the `length`, then all characters to the end of the data are returned.
  Throws:
    `DOMException` - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in `data`, or if the specified `count` is negative.
    DOMSTRING_SIZE_ERR: Raised if the specified range of text does not fit into a `DOMString`.

### appendData

    public void appendData(java.lang.String arg)
                    throws DOMException

  Append the string to the end of the character data of the node. Upon success, `data` provides access to the concatenation of `data` and the `DOMString` specified.
  Specified by:
    `appendData` in interface `CharacterData`
  Parameters:
    `arg` - The `DOMString` to append.
  Throws:
    `DOMException` - NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

### insertData

    public void insertData(int offset,
                           java.lang.String arg)
                    throws DOMException

  Insert a string at the specified character offset.
  Specified by:
    `insertData` in interface `CharacterData`
  Parameters:
    `offset` - The character offset at which to insert.
    `arg` - The `DOMString` to insert.
  Throws:
    `DOMException` - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in `data`.
    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

### deleteData

    public void deleteData(int offset,
                           int count)
                    throws DOMException

  Remove a range of characters from the node. Upon success, `data` and `length` reflect the change.
  Specified by:
    `deleteData` in interface `CharacterData`
  Parameters:
    `offset` - The offset from which to remove characters.
    `count` - The number of characters to delete. If the sum of `offset` and `count` exceeds `length` then all characters from `offset` to the end of the data are deleted.
  Throws:
    `DOMException` - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in `data`, or if the specified `count` is negative.
    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

### replaceData

    public void replaceData(int offset,
                            int count,
                            java.lang.String arg)
                     throws DOMException

  Replace the characters starting at the specified character offset with the specified string.
  Specified by:
    `replaceData` in interface `CharacterData`
  Parameters:
    `offset` - The offset from which to start replacing.
    `count` - The number of characters to replace. If the sum of `offset` and `count` exceeds `length` , then all characters to the end of the data are replaced (i.e., the effect is the same as a `remove` method call with the same range, followed by an `append` method invocation).
    `arg` - The `DOMString` with which the range must be replaced.
  Throws:
    `DOMException` - INDEX_SIZE_ERR: Raised if the specified offset is negative or greater than the number of characters in `data`, or if the specified `count` is negative.
    NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.

### isWhitespaceOnly

    public short isWhitespaceOnly()

  Determines if data is only whitespace.
  Specified by:
    `isWhitespaceOnly` in interface `CharacterDataEditVAL`
  Returns:
    A validation state constant.

### nodeValidity

    public short nodeValidity(boolean deep,
                              short wFValidityCheckLevel)

  Determines if the node is valid relative to the validation type specified in `valType`. This operation doesn't normalize before checking if it is valid. To do so, one would need to explicitly call a normalize method. The difference between this method and the `validateDocument` method on the `DocumentVAL` interface is that `validateDocument` only checks to determine whether the entire document is valid.
  Parameters:
    `wFValidityCheckLevel` - Flag to tell at what level validity and well-formedness checking is done.
  Returns:
    A validation state constant.

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle® Application Server XML Java API Reference 10g Release 2 (10.1.2) Part no. B12024-03 September 2004
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003, 2004, Oracle. All rights reserved.