ex1
Class LangFileParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended byex1.LangFileParser
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class LangFileParser
extends org.xml.sax.helpers.DefaultHandler

This pareses a crop_lang.xml or a operation_lang.xml file and stores information into the parameter name dictionary. This is responsible for picking up the prompt(header), choice list elements, alternate units, factor and additional adder for parameters that were defined in the _DEFN file.


Constructor Summary
LangFileParser(DefnFileParser listing, java.lang.String langFile, boolean isCrop)
          Creates a new instance of LangFileParser
 
Method Summary
 void characters(char[] buf, int offset, int len)
          Part of SAX processing that gets called to get the contents inside an xml tag.
 void endDocument()
          Part of SAX XML processing...
 void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
          Part of SAX processing that gets called when an ending xml tag is encountered.
 void startDocument()
          Part of SAX XML processing...
 void startElement(java.lang.String namespaceURI, java.lang.String lName, java.lang.String qName, org.xml.sax.Attributes attrs)
          Part of SAX processing that gets called at the when an opening xml tag is encountered.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LangFileParser

public LangFileParser(DefnFileParser listing,
                      java.lang.String langFile,
                      boolean isCrop)
Creates a new instance of LangFileParser

Method Detail

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Part of SAX XML processing... Called automatically by SAX parser

Throws:
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Part of SAX XML processing... Called automatically by SAX parser

Throws:
org.xml.sax.SAXException

startElement

public void startElement(java.lang.String namespaceURI,
                         java.lang.String lName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attrs)
                  throws org.xml.sax.SAXException
Part of SAX processing that gets called at the when an opening xml tag is encountered. We will filter out the ones we are interested and set the flags for what the character function should grab and where it will be stored.

Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String namespaceURI,
                       java.lang.String sName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Part of SAX processing that gets called when an ending xml tag is encountered.

Throws:
org.xml.sax.SAXException

characters

public void characters(char[] buf,
                       int offset,
                       int len)
                throws org.xml.sax.SAXException
Part of SAX processing that gets called to get the contents inside an xml tag. The calls to get the contents may not come in one chunk so we need to accumulate caracter strings until the ending tag then the string can be assumed to be complete.

Throws:
org.xml.sax.SAXException