org.objectweb.kilim.repository
Class BasicParserErrorHandler

java.lang.Object
  extended byorg.objectweb.kilim.repository.BasicParserErrorHandler
All Implemented Interfaces:
ParserErrorHandler

public class BasicParserErrorHandler
extends java.lang.Object
implements ParserErrorHandler

Author:
dutoo, horn Implementation of ParserErrorHandler logging exceptions in an output print stream.

Field Summary
private static java.lang.String BASE_HEADER
           
private  java.lang.String header
           
private  java.io.PrintStream out
           
private  java.lang.String templateName
           
 
Constructor Summary
BasicParserErrorHandler()
          Creates a new BasicParserErrorHandler logging errors to System.err.
BasicParserErrorHandler(java.io.OutputStream os)
          Creates a new BasicParserErrorHandler logging errors to the given stream.
 
Method Summary
private  java.lang.String getParseErrorMessage(org.xml.sax.SAXParseException saxex, java.lang.String level)
           
 void handleErrorSAXParseException(org.xml.sax.SAXParseException saxpex)
           
 void handleFatalSAXParseException(org.xml.sax.SAXParseException saxpex)
           
 void handleIOException(java.io.IOException ioex)
           
 void handleKilimException(KilimException ex)
          Method handleKilimException.
 void handleParserConfigurationException(javax.xml.parsers.ParserConfigurationException pcex)
           
 void handleSAXException(org.xml.sax.SAXException saxex)
           
 void handleWarningSAXParseException(org.xml.sax.SAXParseException saxpex)
           
 void setTemplateName(java.lang.String aName)
          Method setTemplateName.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

private java.io.PrintStream out

BASE_HEADER

private static final java.lang.String BASE_HEADER
See Also:
Constant Field Values

header

private java.lang.String header

templateName

private java.lang.String templateName
Constructor Detail

BasicParserErrorHandler

public BasicParserErrorHandler()
Creates a new BasicParserErrorHandler logging errors to System.err.


BasicParserErrorHandler

public BasicParserErrorHandler(java.io.OutputStream os)
Creates a new BasicParserErrorHandler logging errors to the given stream.

Parameters:
os - an output stream
Method Detail

setTemplateName

public void setTemplateName(java.lang.String aName)
Method setTemplateName.

Specified by:
setTemplateName in interface ParserErrorHandler
Parameters:
aName - : the name of the template being parsed.

handleIOException

public void handleIOException(java.io.IOException ioex)
Specified by:
handleIOException in interface ParserErrorHandler
Parameters:
ioex - the exception to be handled
See Also:
ParserErrorHandler.handleIOException(IOException)

handleSAXException

public void handleSAXException(org.xml.sax.SAXException saxex)
Specified by:
handleSAXException in interface ParserErrorHandler
Parameters:
saxex - the exception to be handled
See Also:
ParserErrorHandler.handleSAXException(SAXException)

handleParserConfigurationException

public void handleParserConfigurationException(javax.xml.parsers.ParserConfigurationException pcex)
Specified by:
handleParserConfigurationException in interface ParserErrorHandler
Parameters:
pcex - the exception to be handled
See Also:
ParserErrorHandler.handleParserConfigurationException(ParserConfigurationException)

handleWarningSAXParseException

public void handleWarningSAXParseException(org.xml.sax.SAXParseException saxpex)
Specified by:
handleWarningSAXParseException in interface ParserErrorHandler
Parameters:
saxpex - the exception to be handled
See Also:
ParserErrorHandler.handleWarningSAXParseException(SAXParseException)

handleErrorSAXParseException

public void handleErrorSAXParseException(org.xml.sax.SAXParseException saxpex)
Specified by:
handleErrorSAXParseException in interface ParserErrorHandler
Parameters:
saxpex - the exception to be handled
See Also:
ParserErrorHandler.handleErrorSAXParseException(SAXParseException)

handleFatalSAXParseException

public void handleFatalSAXParseException(org.xml.sax.SAXParseException saxpex)
Specified by:
handleFatalSAXParseException in interface ParserErrorHandler
Parameters:
saxpex - the exception to be handled
See Also:
ParserErrorHandler.handleFatalSAXParseException(SAXParseException)

handleKilimException

public void handleKilimException(KilimException ex)
Description copied from interface: ParserErrorHandler
Method handleKilimException.

Specified by:
handleKilimException in interface ParserErrorHandler
Parameters:
ex - :
See Also:
ParserErrorHandler.handleKilimException(KilimException)

getParseErrorMessage

private java.lang.String getParseErrorMessage(org.xml.sax.SAXParseException saxex,
                                              java.lang.String level)