ch.qos.logback.classic.android
Class ASaxEventRecorder

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by ch.qos.logback.core.joran.event.SaxEventRecorder
          extended by ch.qos.logback.classic.android.ASaxEventRecorder
All Implemented Interfaces:
ContextAware, org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class ASaxEventRecorder
extends SaxEventRecorder

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.

Author:
Anthony Trinh

Field Summary
 
Fields inherited from class ch.qos.logback.core.joran.event.SaxEventRecorder
saxEventList
 
Constructor Summary
ASaxEventRecorder(Context context)
          Constructor
 
Method Summary
 java.util.List<SaxEvent> recordEvents(org.xml.sax.InputSource src)
          Parses SAX events from a compressed Android XML resource
 void setFilter(java.lang.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

ASaxEventRecorder

public ASaxEventRecorder(Context context)
Constructor

Parameters:
context - logger context
Method Detail

setFilter

public void setFilter(java.lang.String... names)
Sets a filter so that only sub-elements of a specific element are captured

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").

Parameters:
names - names of elements leading to the target elements; use null to disable filtering (capture all events)

recordEvents

public java.util.List<SaxEvent> recordEvents(org.xml.sax.InputSource src)
                                      throws JoranException
Parses SAX events from a compressed Android XML resource

Overrides:
recordEvents in class SaxEventRecorder
Parameters:
src - input source pointing to a compressed Android XML resource
Throws:
JoranException