com.adventnet.utilities.xml.sax
Class EXMLParser

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--com.adventnet.utilities.xml.sax.EXMLDefaultHandler
              |
              +--com.adventnet.utilities.xml.sax.EXMLParser

public class EXMLParser
extends EXMLDefaultHandler

Resonably generic parser with restrictions. Can be used only if there are no attributes used and there can be no levels of tag more than 2 Hello Note: Every thing is stored in a hashtable For the above xml file string will be stored as key with the value hello String will be stored as key with the values of in ValueObject as key and value String The starting tag is assumed to be always. Though it does not matter what the starting tag is. It ignored anyway. WARNING : The hashtable if not passed as argument is then case insensitive by default. It will use the inner class CaseInsensitiveHashtable.


Field Summary
(package private)  int level
          To know the level of the xml heirarchy
(package private)  java.util.Vector spVect
          has the elelmst where the specical obejct ValueObject is stored so that its used the next time also to decide whether the key should be a Vector or not
(package private)  boolean startCalled
          To know whether 2 simultaneous start elements were called eg
(package private)  ValueObject valueObject
           
 
Fields inherited from class com.adventnet.utilities.xml.sax.EXMLDefaultHandler
fileName, inputStream, isInputStreamUsed
 
Constructor Summary
EXMLParser(java.io.InputStream is)
           
EXMLParser(java.io.InputStream is, java.util.Hashtable hash)
           
EXMLParser(java.io.InputStream is, java.util.Hashtable hash, boolean startParsing)
           
EXMLParser(java.lang.String s)
          No default constructor.
EXMLParser(java.lang.String s, java.util.Hashtable hash)
           
EXMLParser(java.lang.String s, java.util.Hashtable hash, boolean bool)
          No default constructor.
 
Method Summary
 void excharacters(char[] ch, int start, int length)
           
 void exendElement(java.lang.String uri, java.lang.String localName, java.lang.String name)
           
 void exstartElement(java.lang.String namespaceURI, java.lang.String name, java.lang.String rawName, EXMLAttributes atts)
          Use only rawName or will give problem in j2sdk1.4.0.
 java.util.Hashtable getDataHash()
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class com.adventnet.utilities.xml.sax.EXMLDefaultHandler
characters, endElement, start, startElement
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

valueObject

ValueObject valueObject

level

int level
To know the level of the xml heirarchy

spVect

java.util.Vector spVect
has the elelmst where the specical obejct ValueObject is stored so that its used the next time also to decide whether the key should be a Vector or not

startCalled

boolean startCalled
To know whether 2 simultaneous start elements were called eg
Constructor Detail

EXMLParser

public EXMLParser(java.lang.String s)
           throws java.lang.Exception
No default constructor.
Parameters:
fileName - A valid XML file name and path wrt to the current directory.

EXMLParser

public EXMLParser(java.lang.String s,
                  java.util.Hashtable hash)
           throws java.lang.Exception

EXMLParser

public EXMLParser(java.lang.String s,
                  java.util.Hashtable hash,
                  boolean bool)
           throws java.lang.Exception
No default constructor.
Parameters:
fileName - A valid XML file name and path wrt to the current directory.
startParsing - or not

EXMLParser

public EXMLParser(java.io.InputStream is)
           throws java.lang.Exception

EXMLParser

public EXMLParser(java.io.InputStream is,
                  java.util.Hashtable hash)
           throws java.lang.Exception

EXMLParser

public EXMLParser(java.io.InputStream is,
                  java.util.Hashtable hash,
                  boolean startParsing)
           throws java.lang.Exception
Method Detail

exstartElement

public void exstartElement(java.lang.String namespaceURI,
                           java.lang.String name,
                           java.lang.String rawName,
                           EXMLAttributes atts)
                    throws java.lang.Exception
Use only rawName or will give problem in j2sdk1.4.0. as some default value is different
Overrides:
exstartElement in class EXMLDefaultHandler

excharacters

public void excharacters(char[] ch,
                         int start,
                         int length)
                  throws java.lang.Exception
Overrides:
excharacters in class EXMLDefaultHandler

exendElement

public void exendElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String name)
                  throws java.lang.Exception
Overrides:
exendElement in class EXMLDefaultHandler

getDataHash

public java.util.Hashtable getDataHash()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception