public class ASaxEventRecorder extends SaxEventRecorder
| Constructor and Description |
|---|
ASaxEventRecorder()
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
Map<String,String> |
getAttributeWatchValues()
Gets the attributes set by
setAttributeWatch(String) |
List<SaxEvent> |
recordEvents(InputSource src)
Parses SAX events from a compressed Android XML resource
|
void |
setAttributeWatch(String elemName)
Sets a "watch" for an element's attributes, which can be retrieved
with
getAttributeWatchValues(). |
void |
setFilter(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, warningendDocument, endPrefixMapping, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDeclpublic 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)
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 Map<String,String> getAttributeWatchValues()
setAttributeWatch(String)public List<SaxEvent> recordEvents(InputSource src) throws JoranException
recordEvents in class SaxEventRecordersrc - input source pointing to a compressed Android XML resourceJoranExceptionCopyright © 2005–2014 QOS.ch. All rights reserved.