net.logAnalyzer.patternParser
Class PatternParser

java.lang.Object
  extended bynet.logAnalyzer.patternParser.PatternParser

public class PatternParser
extends java.lang.Object

This class parses a log4j PatternLayout pattern.

The pattern could contain log4j basic converters, but also custom converters.

Each pattern is declared in the <logana:converters> section of the configuration file loaded by ConfigurationManager.

Version:
0.1
Author:
Karim REFEYTON

Field Summary
protected static char CLOSED_BRAKET
           
protected static char CONVERTER_PREFIX
           
protected static char OPENED_BRAKET
           
 
Constructor Summary
PatternParser(java.lang.String pattern)
          Default constructor.
 
Method Summary
 int getLinesToRead()
          Returns the number of lines to read from the log file to parse a log messageLabel.
 LAConverter[] parse()
          Parses the pattern char by char.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONVERTER_PREFIX

protected static final char CONVERTER_PREFIX
See Also:
Constant Field Values

OPENED_BRAKET

protected static final char OPENED_BRAKET
See Also:
Constant Field Values

CLOSED_BRAKET

protected static final char CLOSED_BRAKET
See Also:
Constant Field Values
Constructor Detail

PatternParser

public PatternParser(java.lang.String pattern)
Default constructor.

Parameters:
pattern - Pattern to analysis.
Method Detail

parse

public LAConverter[] parse()
                    throws PatternParsingException
Parses the pattern char by char. The pattern is transformed as a column list.

Throws:
PatternParsingException

getLinesToRead

public int getLinesToRead()
Returns the number of lines to read from the log file to parse a log messageLabel. For example, if a log4j pattern contains a %n converter inside (not at the end), the number of lines is 2.

Returns:
The number of line to read in a log file.


Copyright © 2006 null. All Rights Reserved.