gate.util
Class Lax

java.lang.Object
  |
  +--org.xml.sax.helpers.DefaultHandler
        |
        +--gate.util.Lax
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

LAX (LazyProgrammer Api for XML) layer for a SAX parser, based on Sun's JAXP layer...so it works with any JAXP compliant parser


Constructor Summary
Lax(LaxErrorHandler leh)
          Lax default constructor
Lax(Object handler_, LaxErrorHandler leh)
          Lax ctor with a single handler
 
Method Summary
 void addHandler(Object objHandler_)
          Add a handler to the list of handler objects.
 void characters(char[] caChars, int iStart, int iEnd)
          Handle an incoming block of text by calling the textOf method for the current tag.
 void endDocument()
          endDocument method comment.
 void endElement(String uri, String qName, String sTag)
          Call all end tag methods in the handler list
 void error(org.xml.sax.SAXParseException ex)
          error method comment.
 void fatalError(org.xml.sax.SAXParseException ex)
          fatalError method comment.
 LaxErrorHandler getErrorHandler()
          Get the CustomErrorHandler
 boolean getNamespacesAware()
          Get the namespacesAware property
 boolean getValidating()
          Get the validating property
 void parseXmlDocument(File xmlFile)
           
 void parseXmlDocument(org.xml.sax.InputSource xmlInputSource)
           
 void parseXmlDocument(InputStream xmlInputStream)
           
 void parseXmlDocument(String xmlURI)
           
 void setErrorHandler(LaxErrorHandler leh)
          Sets the CustomErrorHandler
 void setNamespacesAware(boolean namespacesAware)
          Sets the parser to be a namespaces aware one implicit parameter is false (so the parser is not a namespaces aware one)
 void setValidating(boolean validating)
          Sets the parser to be a validating one implicit parameter is false (so the parser is not a validating one)
 void startDocument()
          startDocument method comment.
 void startElement(String uri, String qName, String sTag, org.xml.sax.Attributes alAttrs)
          Call all start methods for this tag.
 void warning(org.xml.sax.SAXParseException ex)
          warning method comment.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lax

public Lax(LaxErrorHandler leh)
Lax default constructor


Lax

public Lax(Object handler_,
           LaxErrorHandler leh)
Lax ctor with a single handler

Method Detail

setErrorHandler

public void setErrorHandler(LaxErrorHandler leh)
Sets the CustomErrorHandler

Parameters:
leh - gate.util.LaxErrorHandler

getErrorHandler

public LaxErrorHandler getErrorHandler()
Get the CustomErrorHandler

Returns:
gate.util.LaxErrorHandler

setValidating

public void setValidating(boolean validating)
Sets the parser to be a validating one implicit parameter is false (so the parser is not a validating one)

Parameters:
validating - boolean

getValidating

public boolean getValidating()
Get the validating property

Returns:
boolean

setNamespacesAware

public void setNamespacesAware(boolean namespacesAware)
Sets the parser to be a namespaces aware one implicit parameter is false (so the parser is not a namespaces aware one)

Parameters:
namespacesAware - boolean

getNamespacesAware

public boolean getNamespacesAware()
Get the namespacesAware property

Returns:
boolean

addHandler

public void addHandler(Object objHandler_)
Add a handler to the list of handler objects.

Parameters:
objHandler_ - java.lang.Object

characters

public void characters(char[] caChars,
                       int iStart,
                       int iEnd)
                throws org.xml.sax.SAXException
Handle an incoming block of text by calling the textOf method for the current tag.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
endDocument method comment.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

endElement

public void endElement(String uri,
                       String qName,
                       String sTag)
                throws org.xml.sax.SAXException
Call all end tag methods in the handler list

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

error

public void error(org.xml.sax.SAXParseException ex)
           throws org.xml.sax.SAXException
error method comment.

Specified by:
error in interface org.xml.sax.ErrorHandler
Overrides:
error in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

fatalError

public void fatalError(org.xml.sax.SAXParseException ex)
                throws org.xml.sax.SAXException
fatalError method comment.

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Overrides:
fatalError in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

parseXmlDocument

public void parseXmlDocument(File xmlFile)

parseXmlDocument

public void parseXmlDocument(org.xml.sax.InputSource xmlInputSource)

parseXmlDocument

public void parseXmlDocument(InputStream xmlInputStream)

parseXmlDocument

public void parseXmlDocument(String xmlURI)

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
startDocument method comment.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException

startElement

public void startElement(String uri,
                         String qName,
                         String sTag,
                         org.xml.sax.Attributes alAttrs)
Call all start methods for this tag.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

warning

public void warning(org.xml.sax.SAXParseException ex)
             throws org.xml.sax.SAXException
warning method comment.

Specified by:
warning in interface org.xml.sax.ErrorHandler
Overrides:
warning in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException