|
|
|||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||
java.lang.Objectcom.lightysoft.logmx.mgr.LogFileParser
public abstract class LogFileParser
Abstract class that each LogMX Parser must extend.
Contains abstract methods to be implemented by Parsers, and final methods to be called by parsers.
ParsedEntry| Constructor Summary | |
|---|---|
LogFileParser()
Default constructor. |
|
| Method Summary | |
|---|---|
protected void |
addEntry(ParsedEntry pParsedEntry)
Called by the Parser for each entry it has successfully parsed. |
protected ParsedEntry |
createNewEntry()
Called by the Parser to create and return a new blank log entry to be used by this Parser. |
abstract Date |
getAbsoluteEntryDate(ParsedEntry pEntry)
Called by LogMX to get the Date of the specified entry,
or null if this Parser could not return the Date for this entry. |
String |
getDescriptionForUser()
Called by LogMX to get a complete description of this parser to build error messages. |
protected Locale |
getLocale()
Called by the Parser to get the Locale to use by this Parser (useful for Date & Time format handling). |
protected String |
getParsedFileName()
Called by the Parser to get the name of the file to be parsed by this Parser. |
abstract String |
getParserName()
Called by LogMX to get the name of this Parser. |
abstract Date |
getRelativeEntryDate(ParsedEntry pEntry)
Called by LogMX to get a timestamp for entry pEntry,
or null if this Parser doesn't support relative timestamps. |
abstract String |
getSupportedFileType()
Called by LogMX to get a short description of supported file type(s). |
List<String> |
getUserDefinedFields()
Called by LogMX to get the ordered list of user-defined fields to display (given by their key), for each entry. |
protected abstract void |
parseLine(String pLine)
Called by LogMX each time a new line is read from the underlying media by the LogFileManager (eg: a line is read from a local file). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public LogFileParser()
| Method Detail |
|---|
protected abstract void parseLine(String pLine)
throws Exception
pLine - New line to process by Parser (should not contain \n or \r).null, that means the LogFileManager has no more line to read.
Exception - If an unexpected error occurs while Parser processed new line. LogMX will then notify
the user with a dialog box and will try to parse the file with the next parser
public abstract Date getRelativeEntryDate(ParsedEntry pEntry)
throws Exception
pEntry,
or null if this Parser doesn't support relative timestamps.T0 matches the launch of the process that writes the log file).pEntry.getExtraInfo()
or pEntry.getDate().
This timestamp can be a complete Date (from milliseconds to year), or a simple number of milliseconds
relative to this entry (e.g.: new Date(125)).e1 and e2 are 'separated' by X milliseconds, thengetRelativeEntryDate(e1).getTime() - getRelativeEntryDate(e2).getTime() |pEntry.
pEntry - Entry which timestamp must be computed
pEntry, or null if this Parser
doesn't support relative timestamps
Exception - If an unexpected error occurs while computing timestamp (should not happen: if Parser can't
compute timestamp for this entry, it should return null)
public abstract Date getAbsoluteEntryDate(ParsedEntry pEntry)
throws Exception
Date of the specified entry,
or null if this Parser could not return the Date for this entry.Date from the String given by pEntry.getDate().
This Date must be a complete one, from Year to Milliseconds (or seconds if file format is not accurate enough).
pEntry.
pEntry - Entry which Date must be computed
pEntry, or null if this Parser could not return its Date
Exception - If an unexpected error occurs while computing Datepublic abstract String getParserName()
public abstract String getSupportedFileType()
public String getDescriptionForUser()
getParserName()
public List<String> getUserDefinedFields()
ParsedEntry.getUserDefinedFields()
protected final ParsedEntry createNewEntry()
protected final void addEntry(ParsedEntry pParsedEntry)
throws Exception
pParsedEntry
produces no effect.
pParsedEntry - Entry parsed by Parser
Exception - If pParsedEntry.getLevel() is an invalid Level and user wants to abort
this Parser process (LogMX will then switch to next Parser). Parser should NOT
catch this Exception: its method parseLine(String)
should simply 'propagate' this Exception so that LogMX can process it.protected final Locale getLocale()
null).
protected final String getParsedFileName()
null).
|
|
|||||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||||