DefaultBraceStyleMessageParser

Default implementation of the brace style message parser. Note that while the underlying parsing mechanism supports the more general "{n,xxx}" form for brace format style logging, the default message parser is currently limited to simple indexed place holders (e.g. "{0}"). This class could easily be extended to support these trailing format specifiers.

Note also that the implicit place holder syntax used by Log4J (i.e. "{}") is not currently supported, however this may change. Currently an unescaped "{}" term in a log message will cause a parse error, so adding support for it should not be an issue.

Inherited properties

Link copied to clipboard
public final static int MAX_ARG_COUNT
The maximum allowed index (this should correspond to the MAX_ALLOWED_WIDTH in FormatOptions because at times it is ambiguous as to which is being parsed).

Functions

Link copied to clipboard
Link copied to clipboard
public void parseBraceFormatTerm(MessageBuilder<? extends Object> builder, int index, String message, int termStart, int formatStart, int termEnd)
Parses a single brace format term from a log message into a message template builder.

Inherited functions

Link copied to clipboard
protected final void parseImpl<T>(MessageBuilder<T> builder)
Abstract parse method implemented by specific subclasses to modify parsing behavior.
Link copied to clipboard
public final void unescape(StringBuilder out, String message, int start, int end)
Appends the unescaped literal representation of the given message string (assumed to be escaped according to this parser's escaping rules).