# com.bea.ide.lang.jsp
IDOMNode Interface

public interface IDOMNode

Base interface for nodes in an HTML or JSP document.

All Known Subinterfaces
  `IDOMAttribute`, `IDOMDocument`, `IDOMElement`, `IDOMTextNode`, `IHTMLComment`, `IHTMLElement`, `IJspAction`, `IJspComment`, `IJspDeclaration`, `IJspDirective`, `IJspDocument`, `IJspExpression`, `IJspScriptlet`, `IJspTaglibDirective`

## Method Summary

`public `IDOMNode`` | `appendChild`(`IDOMNode` newChild)
`public `String`` | `decodeNodeValue`(`IDOMTextNode` node) Decodes the value of a text node which may be the child of this node
`public `IDOMTextNode`` | `encodeNodeValue`(`String` strValue) Encodes the specified value, for adding as a child to this node.
`public int` | `getChildCount`() Returns the number of children of this node.
`public `IDOMNode`` | `getChildNode`(int i) Returns the node at the specified index, or null if that child does not exist.
`public `IDOMNode`` | `getFirstChild`()
`public `IDOMNode`` | `getLastChild`()
`public `String`` | `getNodeName`() Returns the name of this node.
`public `Object`` | `getNodeValue`() Returns the value of the node.
`public `IDOMDocument`` | `getOwnerDocument`() Returns the document to which this node belongs.
`public `IDOMNode`` | `getParentNode`() Returns the parent of this node, or null if it does not have a parent.
`public `IDOMNode`` | `insertAfter`(`IDOMNode` newChild, `IDOMNode` refChild) Adds a child at the specified location
`public `IDOMNode`` | `insertBefore`(`IDOMNode` newChild, `IDOMNode` refChild) Adds a child at the specified location
`public boolean` | `isReadOnly`() If there is an error in the source code of the document, nodes in the tree might not be editable, in order to prevent corrupting the document.
`public boolean` | `matches`(`Class` klazz, `String` strNodeName) Returns true if the node implements the specified interface, and has the specified tagname
`public `IDOMNode`` | `nextSibling`()
`public void` | `normalize`() Ensures that there are no adjacent or empty text nodes in this tree.
`public `IDOMNode`` | `previousSibling`()
`public void` | `reformat`() Indents this children and all of its children according to the user's preferences.
`public `IDOMNode`` | `removeChild`(`IDOMNode` oldChild) Removes the specified child
`public void` | `setNodeValue`(`String` oValue) Sets the value of the node.

## Method Detail

### appendChild(IDOMNode) Method

    public IDOMNode appendChild(IDOMNode newChild)

### decodeNodeValue(IDOMTextNode) Method

    public String decodeNodeValue(IDOMTextNode node)

Decodes the value of a text node which may be the child of this node

#### Parameters

node
  text node whose value is to be decoded

#### Returns

decoded form of the node's value

### encodeNodeValue(String) Method

    public IDOMTextNode encodeNodeValue(String strValue)

Encodes the specified value, for adding as a child to this node.

#### Parameters

strValue
  value to be encoded

#### Returns

a text node which may be added to this node.

### getChildCount() Method

    public int getChildCount()

Returns the number of children of this node.

### getChildNode(int) Method

    public IDOMNode getChildNode(int i)

Returns the node at the specified index, or null if that child does not exist.

### getFirstChild() Method

    public IDOMNode getFirstChild()

### getLastChild() Method

    public IDOMNode getLastChild()

### getNodeName() Method

    public String getNodeName()

Returns the name of this node. For elements, this is the tagName, for attributes, this is the attribute name. Other nodes typically return a constant string.

### getNodeValue() Method

    public Object getNodeValue()

Returns the value of the node.

#### Returns

the value of the node This depends on the type of the node It may be one of the following values: `null` a `String` if the node has a simple value a `IDOMNode` if the node has exactly one child a `IDOMNodeList` if the node has more than one child.

### getOwnerDocument() Method

    public IDOMDocument getOwnerDocument()

Returns the document to which this node belongs. Nodes must be imported into a document, before they can be added to the tree.

### getParentNode() Method

    public IDOMNode getParentNode()

Returns the parent of this node, or null if it does not have a parent.

### insertAfter(IDOMNode, IDOMNode) Method

DEPRECATED this method is a nonstandard DOM method, and should not be used.

    public IDOMNode insertAfter(IDOMNode newChild,
                                IDOMNode refChild)

Adds a child at the specified location

#### Parameters

newChild
  node before which the new node should be added, or null to add at the beginning.

#### Returns

the newly added child

### insertBefore(IDOMNode, IDOMNode) Method

    public IDOMNode insertBefore(IDOMNode newChild,
                                 IDOMNode refChild)

Adds a child at the specified location

#### Parameters

newChild
  node before which the new node should be added, or null to add at the end.

#### Returns

the newly added child

### isReadOnly() Method

    public boolean isReadOnly()

If there is an error in the source code of the document, nodes in the tree might not be editable, in order to prevent corrupting the document.

#### Returns

true if the node cannot be modified without risking corrupting the document.

### matches(Class, String) Method

    public boolean matches(Class klazz,
                           String strNodeName)

Returns true if the node implements the specified interface, and has the specified tagname

### nextSibling() Method

    public IDOMNode nextSibling()

### normalize() Method

    public void normalize()

Ensures that there are no adjacent or empty text nodes in this tree.

### previousSibling() Method

    public IDOMNode previousSibling()

### reformat() Method

    public void reformat()

Indents this children and all of its children according to the user's preferences.

### removeChild(IDOMNode) Method

    public IDOMNode removeChild(IDOMNode oldChild)

Removes the specified child

#### Returns

the removed child, or null if the child is not in the list

### setNodeValue(String) Method

    public void setNodeValue(String oValue)

Sets the value of the node. This has the side effect of removing all of the children of the node.