|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
ch.qos.logback.core.joran.event.SaxEventRecorder
ch.qos.logback.classic.android.ASaxEventRecorder
public class ASaxEventRecorder
SAX event recorder for compressed Android XML resource files. Supports filtering to capture only the sub-events of an event of interest in order to conserve memory usage.
Field Summary |
---|
Fields inherited from class ch.qos.logback.core.joran.event.SaxEventRecorder |
---|
saxEventList |
Constructor Summary | |
---|---|
ASaxEventRecorder()
Constructor |
Method Summary | |
---|---|
String |
getAttributeWatchValue()
Gets the value of the attribute set by setAttributeWatch(String, String) |
List<SaxEvent> |
recordEvents(InputSource src)
Parses SAX events from a compressed Android XML resource |
void |
setAttributeWatch(String elemName,
String attrName)
Sets a "watch" for an element's attribute, which can be retrieved with getAttributeWatchValue() . |
void |
setFilter(String... names)
Sets a filter so that only sub-elements of a specific element are captured |
Methods inherited from class ch.qos.logback.core.joran.event.SaxEventRecorder |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, characters, endElement, error, fatalError, getContext, getLocator, getSaxEventList, recordEvents, setContext, setDocumentLocator, startDocument, startElement, warning |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ASaxEventRecorder()
Method Detail |
---|
public void setFilter(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(String elemName, String attrName)
getAttributeWatchValue()
. During the parsing of the SAX
events, the START-elements are searched for the target attribute.
If found, the attribute's value is stored. This checks all START-
elements, regardless of filtering.
elemName
- name of the element that contains the attributeattrName
- name of the attributepublic String getAttributeWatchValue()
setAttributeWatch(String, String)
public List<SaxEvent> recordEvents(InputSource src) throws JoranException
recordEvents
in class SaxEventRecorder
src
- input source pointing to a compressed Android XML resource
JoranException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |