Top Fields Constructors Methods
ch.qos.logback.core.joran.event

public Class SaxEventRecorder

extends DefaultHandler
implements ContextAware
Class Inheritance
All Implemented Interfaces
ch.qos.logback.core.spi.ContextAware
Static Imports
ch.qos.logback.core.CoreConstants.XML_PARSING

Field Summary

Modifier and TypeField and Description
pack-priv final ContextAwareImpl
pack-priv final ElementPath
pack-priv Locator
pack-priv List<SaxEvent>

Constructor Summary

AccessConstructor and Description
public
public
SaxEventRecorder(Context context, ElementPath elementPath)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
public void
public void
public void
private SAXParser
public void
characters(char[]
The characters.
ch
,
int
The start position in the character array.
start
,
int
The number of characters to use from the character array.
length
)

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Receive notification of character data inside an element.
public void
endElement(String
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
namespaceURI
,
String
The local name (without prefix), or the empty string if Namespace processing is not being performed.
localName
,
String
The qualified name (with prefix), or the empty string if qualified names are not available.
qName
)

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Receive notification of the end of an element.
public void
error(SAXParseException
The error information encoded as an exception.
spe
)

Overrides org.xml.sax.helpers.DefaultHandler.error.

Implements org.xml.sax.ErrorHandler.error.

Receive notification of a recoverable parser error.
public void
fatalError(SAXParseException
The error information encoded as an exception.
spe
)

Overrides org.xml.sax.helpers.DefaultHandler.fatalError.

Implements org.xml.sax.ErrorHandler.fatalError.

Report a fatal XML parsing error.
public Context
pack-priv SaxEvent
public Locator
public List<SaxEvent>
pack-priv String
getTagName(String localName, String qName)

private void
pack-priv boolean
public final void
public void
public void
public void
setDocumentLocator(Locator
A locator for all SAX document events.
l
)

Overrides org.xml.sax.helpers.DefaultHandler.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Receive a Locator object for document events.
protected boolean
public void
startDocument()

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Receive notification of the beginning of the document.
public void
startElement(String
The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.
namespaceURI
,
String
The local name (without prefix), or the empty string if Namespace processing is not being performed.
localName
,
String
The qualified name (with prefix), or the empty string if qualified names are not available.
qName
,
Attributes
The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.
atts
)

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Receive notification of the start of an element.
public void
warning(SAXParseException
The warning information encoded as an exception.
spe
)

Overrides org.xml.sax.helpers.DefaultHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

Receive notification of a parser warning.
Inherited from org.xml.sax.helpers.DefaultHandler:
endDocumentendPrefixMappingignorableWhitespacenotationDeclprocessingInstructionresolveEntityskippedEntitystartPrefixMappingunparsedEntityDecl

Field Detail

contextAwareImplback to summary
pack-priv final ContextAwareImpl contextAwareImpl
elementPathback to summary
pack-priv final ElementPath elementPath
locatorback to summary
pack-priv Locator locator
saxEventListback to summary
pack-priv List<SaxEvent> saxEventList

Constructor Detail

SaxEventRecorderback to summary
public SaxEventRecorder(Context context)
SaxEventRecorderback to summary
public SaxEventRecorder(Context context, ElementPath elementPath)

Method Detail

addErrorback to summary
public void addError(String msg)

Implements ch.qos.logback.core.spi.ContextAware.addError.

addErrorback to summary
public void addError(String msg, Throwable ex)

Implements ch.qos.logback.core.spi.ContextAware.addError.

addInfoback to summary
public void addInfo(String msg)

Implements ch.qos.logback.core.spi.ContextAware.addInfo.

addInfoback to summary
public void addInfo(String msg, Throwable ex)

Implements ch.qos.logback.core.spi.ContextAware.addInfo.

addStatusback to summary
public void addStatus(Status status)

Implements ch.qos.logback.core.spi.ContextAware.addStatus.

addWarnback to summary
public void addWarn(String msg)

Implements ch.qos.logback.core.spi.ContextAware.addWarn.

addWarnback to summary
public void addWarn(String msg, Throwable ex)

Implements ch.qos.logback.core.spi.ContextAware.addWarn.

buildSaxParserback to summary
private SAXParser buildSaxParser() throws JoranException
charactersback to summary
public void characters(char[] ch, int start, int length)

Overrides org.xml.sax.helpers.DefaultHandler.characters.

Implements org.xml.sax.ContentHandler.characters.

Doc from org.xml.sax.helpers.DefaultHandler.characters.

Receive notification of character data inside an element.

By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).

Parameters
ch:char[]

The characters.

start:int

The start position in the character array.

length:int

The number of characters to use from the character array.

endElementback to summary
public void endElement(String namespaceURI, String localName, String qName)

Overrides org.xml.sax.helpers.DefaultHandler.endElement.

Implements org.xml.sax.ContentHandler.endElement.

Doc from org.xml.sax.helpers.DefaultHandler.endElement.

Receive notification of the end of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).

Parameters
namespaceURI:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The qualified name (with prefix), or the empty string if qualified names are not available.

errorback to summary
public void error(SAXParseException spe) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.error.

Implements org.xml.sax.ErrorHandler.error.

Doc from org.xml.sax.helpers.DefaultHandler.error.

Receive notification of a recoverable parser error.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each error, such as inserting the message in a log file or printing it to the console.

Parameters
spe:SAXParseException

The error information encoded as an exception.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
fatalErrorback to summary
public void fatalError(SAXParseException spe) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.fatalError.

Implements org.xml.sax.ErrorHandler.fatalError.

Doc from org.xml.sax.helpers.DefaultHandler.fatalError.

Report a fatal XML parsing error.

The default implementation throws a SAXParseException. Application writers may override this method in a subclass if they need to take specific actions for each fatal error (such as collecting all of the errors into a single report): in any case, the application must stop all regular processing when this method is invoked, since the document is no longer reliable, and the parser may no longer report parsing events.

Parameters
spe:SAXParseException

The error information encoded as an exception.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.
getContextback to summary
public Context getContext()

Implements ch.qos.logback.core.spi.ContextAware.getContext.

getLastEventback to summary
pack-priv SaxEvent getLastEvent()
getLocatorback to summary
public Locator getLocator()
getSaxEventListback to summary
public List<SaxEvent> getSaxEventList()
getTagNameback to summary
pack-priv String getTagName(String localName, String qName)
handleErrorback to summary
private void handleError(String errMsg, Throwable t) throws JoranException
isSpaceOnlyback to summary
pack-priv boolean isSpaceOnly(String bodyStr)
recordEventsback to summary
public final void recordEvents(InputStream inputStream) throws JoranException
recordEventsback to summary
public void recordEvents(InputSource inputSource) throws JoranException
setContextback to summary
public void setContext(Context context)

Implements ch.qos.logback.core.spi.ContextAware.setContext.

setDocumentLocatorback to summary
public void setDocumentLocator(Locator l)

Overrides org.xml.sax.helpers.DefaultHandler.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Doc from org.xml.sax.helpers.DefaultHandler.setDocumentLocator.

Receive a Locator object for document events.

By default, do nothing. Application writers may override this method in a subclass if they wish to store the locator for use with other document events.

Parameters
l:Locator

A locator for all SAX document events.

shouldIgnoreForElementPathback to summary
protected boolean shouldIgnoreForElementPath(String tagName)
startDocumentback to summary
public void startDocument()

Overrides org.xml.sax.helpers.DefaultHandler.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Doc from org.xml.sax.helpers.DefaultHandler.startDocument.

Receive notification of the beginning of the document.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).

startElementback to summary
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)

Overrides org.xml.sax.helpers.DefaultHandler.startElement.

Implements org.xml.sax.ContentHandler.startElement.

Doc from org.xml.sax.helpers.DefaultHandler.startElement.

Receive notification of the start of an element.

By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).

Parameters
namespaceURI:String

The Namespace URI, or the empty string if the element has no Namespace URI or if Namespace processing is not being performed.

localName:String

The local name (without prefix), or the empty string if Namespace processing is not being performed.

qName:String

The qualified name (with prefix), or the empty string if qualified names are not available.

atts:Attributes

The attributes attached to the element. If there are no attributes, it shall be an empty Attributes object.

warningback to summary
public void warning(SAXParseException spe) throws SAXException

Overrides org.xml.sax.helpers.DefaultHandler.warning.

Implements org.xml.sax.ErrorHandler.warning.

Doc from org.xml.sax.helpers.DefaultHandler.warning.

Receive notification of a parser warning.

The default implementation does nothing. Application writers may override this method in a subclass to take specific actions for each warning, such as inserting the message in a log file or printing it to the console.

Parameters
spe:SAXParseException

The warning information encoded as an exception.

Exceptions
SAXException:
Any SAX exception, possibly wrapping another exception.