|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.perf4j.helpers.StopWatchParser
public class StopWatchParser
This helper class is used to parse StopWatches from log message.
Field Summary | |
---|---|
static String |
DEFAULT_MATCH_PATTERN
The default regex used to parse StopWatches from Strings. |
Constructor Summary | |
---|---|
StopWatchParser()
Creates a StopWatchParser that uses the DEFAULT_MATCH_PATTERN to parse StopWatch message strings. |
|
StopWatchParser(String matchPattern)
Creates a StopWatchParser that uses the specified regex pattern string to parse StopWatch message strings. |
Method Summary | |
---|---|
Pattern |
getPattern()
Gets the Pattern object used by this StopWatchParser to parse StopWatch message strings. |
MatchResult |
match(String message)
Gets the MatchResult object that is returned when the Pattern used by this parser matches the specified message. |
StopWatch |
parseStopWatch(String message)
This method parses a StopWatch from the given message string. |
StopWatch |
parseStopWatchFromLogMatch(MatchResult matchResult)
Helper method returns a new StopWatch from the MatchResult returned when a log messages matches. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEFAULT_MATCH_PATTERN
Constructor Detail |
---|
public StopWatchParser()
public StopWatchParser(String matchPattern)
matchPattern
- The regex pattern String to use to parse log messages
PatternSyntaxException
- Thrown if matchPattern is not a valid regex pattern.Method Detail |
---|
public Pattern getPattern()
public StopWatch parseStopWatch(String message)
message
- The message to parse, which was likely created with the StopWatch stop, lap or toString methods.
public MatchResult match(String message)
message
- The StopWatch message to parse.
public StopWatch parseStopWatchFromLogMatch(MatchResult matchResult)
matchResult
- The regex match result
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |