JCas
v0.3.1

cas.xml
Class CasSaxParser

java.lang.Object
  extended byorg.xml.sax.helpers.DefaultHandler
      extended bycas.xml.CasSaxParser
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class CasSaxParser
extends DefaultHandler

Handles the SAX events when parsing the configuration file and creates the configuration.

Version:
1.0
Author:
Ralph Schuster

Field Summary
protected  CasSaxTagHandler rootHandler
          The main tag handler
 
Constructor Summary
CasSaxParser(CasSaxTagHandler rootHandler)
          Creates a new instance of CasSaxHandler
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receive notification of character data inside an element.
 void endDocument()
          Calls CasSaxTagHandler.tagCompleted() of the topmost handler for validation.
 void endElement(String uri, String localName, String qName)
          Receive notification of the end of an element.
 CasSaxTagHandler getRootHandler()
          Returns the configuration.
 void startElement(String uri, String localName, String qName, Attributes attributes)
          Receive notification of the start of an element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
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

rootHandler

protected CasSaxTagHandler rootHandler
The main tag handler

Constructor Detail

CasSaxParser

public CasSaxParser(CasSaxTagHandler rootHandler)
Creates a new instance of CasSaxHandler

Method Detail

getRootHandler

public CasSaxTagHandler getRootHandler()
Returns the configuration.


startElement

public void startElement(String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Receive notification of the start of an element.

Parameters:
attributes - - The specified or defaulted attributes.
localName - - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - - The qualified name (with prefix), or the empty string if qualified names are not available.
Throws:
SAXException - - Any SAX exception, possibly wrapping another exception.
See Also:
ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)

endElement

public void endElement(String uri,
                       String localName,
                       String qName)
                throws SAXException
Receive notification of the end of an element.

Parameters:
localName - - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - - The qualified name (with prefix), or the empty string if qualified names are not available.
Throws:
SAXException - - Any SAX exception, possibly wrapping another exception.
See Also:
ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Receive notification of character data inside an element.

Parameters:
ch - - The characters.
start - - The start position in the character array.
length - - The number of characters to use from the character array.
Throws:
SAXException - - Any SAX exception, possibly wrapping another exception.
See Also:
ContentHandler.characters(char[], int, int)

endDocument

public void endDocument()
                 throws SAXException
Calls CasSaxTagHandler.tagCompleted() of the topmost handler for validation.

Throws:
SAXException

JCas
v0.3.1