com.japisoft.dtdparser.node
Class DTDNode

java.lang.Object
  extended bycom.japisoft.dtdparser.node.DTDNode
Direct Known Subclasses:
AttributeDTDNode, CommentDTDNode, ElementDTDNode, EntityDTDNode, RootDTDNode

public class DTDNode
extends java.lang.Object

Main node type for DTD document type

Since:
1.0
Version:
1.0
Author:
(c) 2002-2003 JAPISOFT

Field Summary
static int ATTRIBUTE
          Attribute type
static int COMMENT
          Comment type
static int ELEMENT
          Element type
static int ELEMENT_REF
          Element set content
static int ELEMENT_SET
          Element set
static int ENTITY
          Entity type
static int ROOT
          Root type
 
Constructor Summary
DTDNode()
           
 
Method Summary
 void addDTDNode(DTDNode node)
          Add a DTDNode child / @return the added node
 DTDNode getDTDNodeAt(int index)
           
 int getDTDNodeCount()
           
 java.util.Enumeration getDTDNodeForType(int type)
           
 int getDTDNodeIndex(DTDNode node)
           
 java.util.Enumeration getDTDNodes()
           
 DTDNode getDTDParentNode()
           
 java.lang.String getNodeComment()
           
 int getNodeType()
           
 RootDTDNode getRoot()
           
 boolean isAttribute()
           
 boolean isComment()
           
 boolean isElement()
           
 boolean isElementRef()
           
 boolean isElementSet()
           
 boolean isEmpty()
           
 boolean isEntity()
           
 boolean isRoot()
           
 void removeDTDNode(DTDNode node)
          Remove a DTDNode child
 void setDTDParentNode(DTDNode parent)
          Reset the parent node
 void setNodeComment(java.lang.String value)
          Set the node comment
 void setNodeType(int type)
          Reset the node type : COMMENT, ENTITY, ELEMENT or ATTRIBUTE
 void setRoot(RootDTDNode node)
          Reset the root node
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COMMENT

public static final int COMMENT
Comment type

See Also:
Constant Field Values

ENTITY

public static final int ENTITY
Entity type

See Also:
Constant Field Values

ELEMENT

public static final int ELEMENT
Element type

See Also:
Constant Field Values

ATTRIBUTE

public static final int ATTRIBUTE
Attribute type

See Also:
Constant Field Values

ROOT

public static final int ROOT
Root type

See Also:
Constant Field Values

ELEMENT_SET

public static final int ELEMENT_SET
Element set

See Also:
Constant Field Values

ELEMENT_REF

public static final int ELEMENT_REF
Element set content

See Also:
Constant Field Values
Constructor Detail

DTDNode

public DTDNode()
Method Detail

setNodeType

public void setNodeType(int type)
Reset the node type : COMMENT, ENTITY, ELEMENT or ATTRIBUTE


getNodeType

public int getNodeType()
Returns:
the node type : COMMENT, ENTITY, ELEMENT or ATTRIBUTE

setRoot

public void setRoot(RootDTDNode node)
Reset the root node


getRoot

public RootDTDNode getRoot()
Returns:
the root node

isComment

public boolean isComment()
Returns:
true for comment node

isEntity

public boolean isEntity()
Returns:
true for entity node

isElement

public boolean isElement()
Returns:
true for tag description

isAttribute

public boolean isAttribute()
Returns:
true for attribute description

isRoot

public boolean isRoot()
Returns:
true if this is the root node

isElementSet

public boolean isElementSet()
Returns:
true for a set of element

isElementRef

public boolean isElementRef()
Returns:
true for a part of set of element

setNodeComment

public void setNodeComment(java.lang.String value)
Set the node comment


getNodeComment

public java.lang.String getNodeComment()
Returns:
the node comment

isEmpty

public boolean isEmpty()
Returns:
true for empty node

addDTDNode

public void addDTDNode(DTDNode node)
Add a DTDNode child / @return the added node


removeDTDNode

public void removeDTDNode(DTDNode node)
Remove a DTDNode child


getDTDNodeCount

public int getDTDNodeCount()
Returns:
the DTDNode children count

getDTDNodeAt

public DTDNode getDTDNodeAt(int index)
Returns:
a DTDNode child at index from 0 to DTDNodeCount - 1

getDTDNodeIndex

public int getDTDNodeIndex(DTDNode node)
Returns:
the index of the node parameter or -1 for leaf case

getDTDNodes

public java.util.Enumeration getDTDNodes()
Returns:
all children

setDTDParentNode

public void setDTDParentNode(DTDNode parent)
Reset the parent node


getDTDParentNode

public DTDNode getDTDParentNode()
Returns:
the parent node

getDTDNodeForType

public java.util.Enumeration getDTDNodeForType(int type)
Returns:
all children matching the type