ProgramixGenericLib v5.0.1

com.programix.saxplus
Class SAXPlusProcessor

java.lang.Object
  extended by com.programix.saxplus.SAXPlusProcessor

public class SAXPlusProcessor
extends Object

Central piece of SAXPlus parsing. First, the TagHandler for the "root" XML element is specified during construction. This is the only tag handler needed at this level as each tag handler delegates to "sub tag" handlers as necessary. Second, if you can optionally call setErrorHandler(ErrorHandler) if you want parsing errors to be reported to someplace other than System.err. Third, if you are in a debugging mode, you'll probably want to call setTrace(true) to see a trace of the parsing as each XML tag is processed. Finally, choose one of the parse methods to initiate the parsing of an XML document.

Author:
Paul Hyde

Constructor Summary
SAXPlusProcessor(TagHandler rootHandler)
          Builds an instance that will use rootHandler at the initial TagHandler.
 
Method Summary
 Value process(InputSource source)
           
 Value process(InputSource source, boolean namespaceAware, boolean validating)
           
 Value process(String source)
           
 Value process(String source, boolean namespaceAware, boolean validating)
           
 Value process(XMLReader reader, InputSource source)
           
 Value process(XMLReader reader, String source)
           
 void setErrorHandler(ErrorHandler errorHandler)
          Specifies the SAX ErrorHandler that is interested in being informed of warnings, errors, and fatal errors encountered during parsing.
 void setTrace(boolean trace)
          Passing true specifies that a trace of internal activity should be printed to System.out.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAXPlusProcessor

public SAXPlusProcessor(TagHandler rootHandler)
Builds an instance that will use rootHandler at the initial TagHandler.

Method Detail

setErrorHandler

public void setErrorHandler(ErrorHandler errorHandler)
Specifies the SAX ErrorHandler that is interested in being informed of warnings, errors, and fatal errors encountered during parsing. If this method is never called, or if null is passed in, an instance of ConsoleErrorHandler is used.


setTrace

public void setTrace(boolean trace)
Passing true specifies that a trace of internal activity should be printed to System.out. This method is only really useful for debugging. If this method is never called, or if false is passed in, then no trace information is printed.


process

public Value process(XMLReader reader,
                     InputSource source)
              throws SAXException
Throws:
SAXException

process

public Value process(XMLReader reader,
                     String source)
              throws SAXException
Throws:
SAXException

process

public Value process(InputSource source,
                     boolean namespaceAware,
                     boolean validating)
              throws SAXException
Throws:
SAXException

process

public Value process(String source,
                     boolean namespaceAware,
                     boolean validating)
              throws SAXException
Throws:
SAXException

process

public Value process(InputSource source)
              throws SAXException
Throws:
SAXException

process

public Value process(String source)
              throws SAXException
Throws:
SAXException

ProgramixGenericLib v5.0.1

Copyright © 2001-2009 Programix Incorporated. All rights reserved. ProgramixGenericLib is free and is OSI Certified Open Source Software under the BSD license.