class XMLFileHandler extends DefaultHandler
Modifier and Type | Field and Description |
---|---|
private StringBuffer |
mBuf
buffer for collecting text
|
private String |
mCategoryName
the category of the event
|
private Level |
mLevel
the priority (level) of the event
|
private String |
mLocationDetails
the location details for the event
|
private String |
mMessage
the msg for the event
|
private MyTableModel |
mModel
where to put the events
|
private String |
mNDC
the NDC for the event
|
private int |
mNumEvents
the number of events in the document
|
private String |
mThreadName
the thread for the event
|
private String[] |
mThrowableStrRep
the throwable details the event
|
private long |
mTimeStamp
the time of the event
|
private static String |
TAG_EVENT
represents the event tag
|
private static String |
TAG_LOCATION_INFO
represents the location info tag
|
private static String |
TAG_MESSAGE
represents the message tag
|
private static String |
TAG_NDC
represents the ndc tag
|
private static String |
TAG_THROWABLE
represents the throwable tag
|
Constructor and Description |
---|
XMLFileHandler(MyTableModel aModel)
Creates a new
XMLFileHandler instance. |
Modifier and Type | Method and Description |
---|---|
private void |
addEvent()
Add an event to the model
|
void |
characters(char[] aChars,
int aStart,
int aLength)
Receive notification of character data inside an element.
|
void |
endElement(String aNamespaceURI,
String aLocalName,
String aQName)
Receive notification of the end of an element.
|
(package private) int |
getNumEvents() |
private void |
resetData()
Reset the data for an event
|
void |
startDocument()
Receive notification of the beginning of the document.
|
void |
startElement(String aNamespaceURI,
String aLocalName,
String aQName,
Attributes aAtts)
Receive notification of the start of an element.
|
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
private static final String TAG_EVENT
private static final String TAG_MESSAGE
private static final String TAG_NDC
private static final String TAG_THROWABLE
private static final String TAG_LOCATION_INFO
private final MyTableModel mModel
private int mNumEvents
private long mTimeStamp
private String mCategoryName
private String mThreadName
private String[] mThrowableStrRep
private String mLocationDetails
private final StringBuffer mBuf
XMLFileHandler(MyTableModel aModel)
XMLFileHandler
instance.aModel
- where to add the eventspublic void startDocument() throws SAXException
DefaultHandler
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).
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
- Any SAX exception, possibly
wrapping another exception.DefaultHandler
public void characters(char[] aChars, int aStart, int aLength)
DefaultHandler
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).
characters
in interface ContentHandler
characters
in class DefaultHandler
aChars
- The characters.aStart
- The start position in the character array.aLength
- The number of characters to use from the
character array.DefaultHandler
public void endElement(String aNamespaceURI, String aLocalName, String aQName)
DefaultHandler
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).
endElement
in interface ContentHandler
endElement
in class DefaultHandler
aLocalName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.aQName
- The qualified XML 1.0 name (with prefix), or the
empty string if qualified names are not available.DefaultHandler
public void startElement(String aNamespaceURI, String aLocalName, String aQName, Attributes aAtts)
DefaultHandler
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).
startElement
in interface ContentHandler
startElement
in class DefaultHandler
aLocalName
- The local name (without prefix), or the
empty string if Namespace processing is not being
performed.aQName
- The qualified name (with prefix), or the
empty string if qualified names are not available.aAtts
- The specified or defaulted attributes.DefaultHandler
int getNumEvents()
private void addEvent()
private void resetData()
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses