JCas
v0.3.1

cas.protocol
Class JCasRequestHandler

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

public class JCasRequestHandler
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 handler
          The main tag handler
protected  PropertyChangeListener listener
          The property listener.
protected  boolean listenerInformed
          if listener was informed about start
static String XML_PARSING_FINISHED
          Parsing stopped property
static String XML_PARSING_STARTED
          Parsing started property
 
Constructor Summary
JCasRequestHandler(PropertyChangeListener listener)
          Creates a new instance of JCasSaxHandler
 
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 getRequest()
          Returns the configuration.
 boolean isAdminRequest()
          Returns if the request was an admin or authorization request.
 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

XML_PARSING_STARTED

public static final String XML_PARSING_STARTED
Parsing started property

See Also:
Constant Field Values

XML_PARSING_FINISHED

public static final String XML_PARSING_FINISHED
Parsing stopped property

See Also:
Constant Field Values

handler

protected CasSaxTagHandler handler
The main tag handler


listener

protected PropertyChangeListener listener
The property listener.


listenerInformed

protected boolean listenerInformed
if listener was informed about start

Constructor Detail

JCasRequestHandler

public JCasRequestHandler(PropertyChangeListener listener)
Creates a new instance of JCasSaxHandler

Method Detail

getRequest

public CasSaxTagHandler getRequest()
Returns the configuration.


isAdminRequest

public boolean isAdminRequest()
Returns if the request was an admin or authorization request.


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