Class RecordParser
.history or .log file, in the
grammar AgentRecordFormat's patterns write.
A record starts with a line that parses, and the lines after it that do not parse belong to
it, as the other lines of a message written over several lines do. A line that does not parse
gives an empty result. A line parses only from its start, so a line indented as
AgentRecordFormat's patterns write a message's later lines never starts a record.
Only a line feed, with or without a carriage return before it, ends a line. Any other line
terminator in a message, such as a lone carriage return or U+2028, is part of the line it
is in, so the record that line starts keeps it.
The conversation field is read in three states: present with an id, present with
"-" (or blank) for a line written outside any
conversation, and absent on a line written before the field existed. Its value is opaque.
A line without the field whose writer's name itself starts with a bracketed word, such as an
agent named [x], is read as if that word were the field.
- Since:
- 0.18.6
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe first line of a record. -
Method Summary
Modifier and TypeMethodDescriptionstatic RecordParserA parser of one agent's history file, whose lines carry the agent's name before the message.static RecordParserlog()A parser of a log file, whose lines carry a level and a logger name.Parses a line as the first line of a record.
-
Method Details
-
history
A parser of one agent's history file, whose lines carry the agent's name before the message.- Parameters:
agentName- the agent the history belongs to- Returns:
- the parser
- Throws:
NullPointerException- ifagentNameisnull
-
log
A parser of a log file, whose lines carry a level and a logger name.- Returns:
- the parser
-
parse
Parses a line as the first line of a record.- Parameters:
line- one line, without its line break- Returns:
- the record the line starts, or empty when it continues the one before it
- Throws:
NullPointerException- iflineisnull
-