|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbb.util.logging.FormatterFull.Parser
public static class FormatterFull.Parser
Class which parses LogRecord
s from data generated by format
.
Instances are constructed with a Reader (e.g. a FileReader) to the data,
and users may then call next
to read off each LogRecord in sequence.
This class is not multithread safe.
Nested Class Summary | |
---|---|
private static class |
FormatterFull.Parser.LogRecordData
|
Field Summary | |
---|---|
private FormatterFull.Parser.LogRecordData |
data
|
private ParseReader |
in
|
private StringBuilder |
sb
|
Constructor Summary | |
---|---|
FormatterFull.Parser(Reader reader)
Constructor. |
Method Summary | |
---|---|
void |
close()
Closes all resources used by this instance. |
private void |
confirmEntrySeparatorNext()
|
LogRecord |
next()
This method assumes that either an entrySeparator has previously been read from in, so that data for a LogRecord is next, or that end of stream has been encountered. |
private boolean |
parseLineSecond()
|
private void |
parseLinesRemaining()
As per the next contract,
will lump any remaining info into data . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private final ParseReader in
private final StringBuilder sb
private final FormatterFull.Parser.LogRecordData data
Constructor Detail |
---|
public FormatterFull.Parser(Reader reader) throws IllegalArgumentException, IOException, IllegalStateException
The final action is a call to confirmEntrySeparatorNext
,
which ensures that the user of this instance can immediately make a call to next
.
IllegalArgumentException
- if reader == null
IOException
- if any I/O problem occurs
IllegalStateException
- if confirmEntrySeparatorNext finds a problemMethod Detail |
---|
private void confirmEntrySeparatorNext() throws IOException, IllegalStateException
IOException
IllegalStateException
public LogRecord next() throws ParseException
The LogRecord must have been written in a format exactly equivalent to that
produced by the format
method.
The result returned by this method may not exactly equal the original LogRecord. In particular, it cannot undo localization and parameter substitution, nor does it attempt to parse any Throwable information. Instead, that information is simply added in its raw text form to the message field of the result.
ParseException
- if any problem in parsing is encounteredprivate boolean parseLineSecond() throws IOException, ParseException, NumberFormatException, IllegalArgumentException
IOException
ParseException
NumberFormatException
IllegalArgumentException
private void parseLinesRemaining() throws IOException
next
contract,
will lump any remaining info into data
.FormatterFull.Parser.LogRecordData.message
.
IOException
public void close()
close
in interface Closeable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |