public class ASaxEventRecorder
extends ch.qos.logback.core.joran.event.SaxEventRecorder
| Constructor and Description |
|---|
ASaxEventRecorder() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
getAttributeWatchValues()
Gets the attributes set by
setAttributeWatch(String) |
java.util.List<ch.qos.logback.core.joran.event.SaxEvent> |
recordEvents(org.xml.sax.InputSource src)
Parses SAX events from a compressed Android XML resource
|
void |
setAttributeWatch(java.lang.String elemName)
Sets a "watch" for an element's attributes, which can be retrieved
with
getAttributeWatchValues(). |
void |
setFilter(java.lang.String... names)
Sets a filter so that only sub-elements of a specific element
are captured
|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, characters, endElement, error, fatalError, getContext, getLocator, getSaxEventList, recordEvents, setContext, setDocumentLocator, startDocument, startElement, warningpublic void setFilter(java.lang.String... names)
For example, if the desired elements were inside
<x><y>
and the input were
<x><y><a/><b/><c/></x></y>
the filter would pass
<a/><b/><c/>
The call in this example would be: setFilter("x", "y").names - names of elements leading to the target elements;
use null to disable filtering (capture all events)public void setAttributeWatch(java.lang.String elemName)
getAttributeWatchValues(). During the parsing of the SAX
events, the START-elements are searched for the target element name.
If found, the element's attributes are stored. This checks all START-
elements, regardless of filtering.elemName - name of the elementpublic java.util.Map<java.lang.String,java.lang.String> getAttributeWatchValues()
setAttributeWatch(String)public java.util.List<ch.qos.logback.core.joran.event.SaxEvent> recordEvents(org.xml.sax.InputSource src)
throws ch.qos.logback.core.joran.spi.JoranException
recordEvents in class ch.qos.logback.core.joran.event.SaxEventRecordersrc - input source pointing to a compressed Android XML resourcech.qos.logback.core.joran.spi.JoranException