org.wso2.balana.ctx
Class InputParser

java.lang.Object
  extended by org.wso2.balana.ctx.InputParser
All Implemented Interfaces:
ErrorHandler

public class InputParser
extends Object
implements ErrorHandler

A package-private helper that provides a single static routine for parsing input based on the context schema.

Since:
1.0
Author:
Seth Proctor

Method Summary
 void error(SAXParseException exception)
          Standard handler routine for the XML parsing.
 void fatalError(SAXParseException exception)
          Standard handler routine for the XML parsing.
static Node parseInput(InputStream input, String rootTag)
          Tries to Parse the given output as a Context document.
 void warning(SAXParseException exception)
          Standard handler routine for the XML parsing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

parseInput

public static Node parseInput(InputStream input,
                              String rootTag)
                       throws ParsingException
Tries to Parse the given output as a Context document.

Parameters:
input - the stream to parse
rootTage - either "Request" or "Response"
Returns:
the root node of the request/response
Throws:
ParsingException - if a problem occurred parsing the document

warning

public void warning(SAXParseException exception)
             throws SAXException
Standard handler routine for the XML parsing.

Specified by:
warning in interface ErrorHandler
Parameters:
exception - information on what caused the problem
Throws:
SAXException

error

public void error(SAXParseException exception)
           throws SAXException
Standard handler routine for the XML parsing.

Specified by:
error in interface ErrorHandler
Parameters:
exception - information on what caused the problem
Throws:
SAXException - always to halt parsing on errors

fatalError

public void fatalError(SAXParseException exception)
                throws SAXException
Standard handler routine for the XML parsing.

Specified by:
fatalError in interface ErrorHandler
Parameters:
exception - information on what caused the problem
Throws:
SAXException - always to halt parsing on errors


Copyright © 2015 WSO2. All rights reserved.