|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.logAnalyzer.converters.LAConverter
This class implements a Log4J pattern converter. It is used to parse or convert a log messageLabel part.
Constructor Summary | |
LAConverter(ConverterDefinition definition,
java.lang.String literal)
Constructs a new converter from a converter definition. |
Method Summary | |
java.lang.String |
getLabel()
Returns the converter label. |
java.lang.String |
getLiteral()
Returns the literal value identifying the literal in the Log4J pattern. |
LAConverter |
getNext()
Returns the next converter. |
java.lang.String |
getOption()
Returns the option string of the converter. |
abstract java.lang.Class |
getValueClass()
Returns the class of the values affected to the column (for example java.lang.String or java.lang.Double). |
boolean |
isLiteral()
Returns true if the converter is a literal. |
boolean |
isMessage()
Returns true if the converter is a messageLabel converter. |
abstract java.lang.Object |
parse(java.lang.String value)
Parse a string value to the value class as returned by getValueClass() . |
java.lang.Object |
parse(java.lang.StringBuffer message,
LALogHandler handler)
Parses the message string to extract a value. |
void |
setNext(LAConverter next)
Sets the next converter. |
void |
setOption(java.lang.String option)
Sets the option string of the converter. |
java.lang.String |
toString()
Returns the converter label. |
abstract java.lang.String |
toString(java.lang.Object value)
Returns a string representation of the value calling toString(). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public LAConverter(ConverterDefinition definition, java.lang.String literal)
definition
- Definition of the converter.literal
- Literal value identifying the converter.Method Detail |
public java.lang.String getLabel()
public boolean isLiteral()
public java.lang.String getLiteral()
public boolean isMessage()
A messageLabel is a special field which could be extended during parsing process.
For example, if you log a Java exception, the exception may be written on more than one line, so the parsing process has to concat several lines to get the complete messageLabel.
public java.lang.String getOption()
public void setOption(java.lang.String option)
option
- LAConverter optionpublic LAConverter getNext()
public void setNext(LAConverter next)
next
- Next converter.public abstract java.lang.Class getValueClass()
public java.lang.Object parse(java.lang.StringBuffer message, LALogHandler handler) throws ParsingException
message
- String to parse.handler
- Log handler parsing.
ParsingException
- If can't parse messageLabel.public abstract java.lang.Object parse(java.lang.String value) throws ParsingException
getValueClass()
.
value
- String value to parse.
ParsingException
- If value can't be parsed.public abstract java.lang.String toString(java.lang.Object value)
value
- Value to convert as String.
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |