|
Copyright (C) 2003,2004 dr. Cristiano Sadun | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sadun.text.ffp.BaseListener org.sadun.text.ffp.EchoListener
A FlatFileParser.Listener
which
echoes the parsed data when a LineFormat
whose is found whose name
matches a regular expression (provided at construction). For example,
FlatFileParser ffp = new FlatFileParser(); ..set up three LineFormat objects, one named "header", the second "data1" and the third "data2" ffp.addListener(new DumpListener("data*"));
Constructor Summary | |
EchoListener()
Create an EchoListener which echoes every line on System out. |
|
EchoListener(java.io.PrintStream out)
Create an EchoListener which echoes every line on the given stream. |
|
EchoListener(java.lang.String regexp)
Create an EchoListener which echoes lines whose format name matches the given regular expression on System.out. |
|
EchoListener(java.lang.String regexp,
java.io.PrintStream out)
Create an EchoListener which echoes lines whose format name matches the given regular expression on the given stream. |
Method Summary | |
protected void |
onFormatName(LineFormat format,
int logicalLineCount,
int physicalLineCount,
java.lang.String[] values)
Invoked when a line whose format name matches the name or regexp provided at construction is found. |
Methods inherited from class org.sadun.text.ffp.BaseListener |
lineParsed |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public EchoListener(java.lang.String regexp, java.io.PrintStream out)
regexp
- the regular expression that the parsed line format's name must matchout
- the stream to echo topublic EchoListener(java.lang.String regexp)
regexp
- the regular expression that the parsed line format's name must matchpublic EchoListener(java.io.PrintStream out)
out
- the stream to echo topublic EchoListener()
Method Detail |
protected final void onFormatName(LineFormat format, int logicalLineCount, int physicalLineCount, java.lang.String[] values)
BaseListener
onFormatName
in class BaseListener
values
- the parsed values
|
Copyright (C) 2003,2004 dr. Cristiano Sadun | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |