xmltool.datastructure
Class PData

java.lang.Object
  |
  +--xmltool.datastructure.PData

public class PData
extends java.lang.Object
implements java.lang.Cloneable

All parsing (using IBM Alphaworks parser) and mapping a DTD to a ParsedData structure is done by this class.


Field Summary
 ParsedData root
          Root ParsedData of the DTD
 java.lang.String[] valAll
          Validation array, to check if all the elements have been considered
 boolean valid
          Flag to denote if the filename for the DTD entered is valid
 java.util.Vector vect
          Vector which contains the child elements
 int vectCount
          Total number of DTD elements having child elements
 
Constructor Summary
PData()
          Default constructor
 
Method Summary
 com.ibm.xml.parser.DTD getDTD()
           
 boolean inArray(java.lang.String string)
          Returns if the element or attribute has been considered or not
 ParsedData isParsed(java.lang.String string)
          Returns the reference of the ParsedData if it occurs more than once in the dTD, so that we dont have infinite looping.
 ParsedData parseIt(java.lang.String mystring)
          Parser
 void putIntoArray(java.lang.String string)
          Puts into ValAll, all the elements and attributes
 ParsedData recursiveIsParsed(ParsedData pd, java.lang.String string)
          This is doing the recursive job of traversing thro the data structures and returns the answer needed by isParsed
 void Validate(java.util.Vector vects, ParsedData parent, int count)
          Validates the elements and its children and makes the complex ParsedData structure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

public ParsedData root
Root ParsedData of the DTD

valid

public boolean valid
Flag to denote if the filename for the DTD entered is valid

vectCount

public int vectCount
Total number of DTD elements having child elements

vect

public java.util.Vector vect
Vector which contains the child elements

valAll

public java.lang.String[] valAll
Validation array, to check if all the elements have been considered
Constructor Detail

PData

public PData()
Default constructor
Method Detail

getDTD

public com.ibm.xml.parser.DTD getDTD()

parseIt

public ParsedData parseIt(java.lang.String mystring)
Parser
Parameters:
string - The filename of the DTD to be parsed return ParsedData The root ParsedData of the DTD to be parsed

isParsed

public ParsedData isParsed(java.lang.String string)
Returns the reference of the ParsedData if it occurs more than once in the dTD, so that we dont have infinite looping. This referenced is then cloned and used as needed at runtime

recursiveIsParsed

public ParsedData recursiveIsParsed(ParsedData pd,
                                    java.lang.String string)
This is doing the recursive job of traversing thro the data structures and returns the answer needed by isParsed

inArray

public boolean inArray(java.lang.String string)
Returns if the element or attribute has been considered or not
Parameters:
string - the element or attribute to be checked return boolean true if the element is present in the array, else false

putIntoArray

public void putIntoArray(java.lang.String string)
Puts into ValAll, all the elements and attributes
Parameters:
string - the element or attribute to be entered

Validate

public void Validate(java.util.Vector vects,
                     ParsedData parent,
                     int count)
Validates the elements and its children and makes the complex ParsedData structure
Parameters:
vects - Vector containing children of the current element
parent - Parent ParsedData of this vects
count - Element[count] in the ParsedData of the parent whose child is "parent.elemsPD[count]"