Class TokenStream
java.lang.Object
ch.qos.logback.core.pattern.parser.TokenStream
Return a steady stream of tokens.
The returned tokens are one of: LITERAL, '%', FORMAT_MODIFIER, SIMPLE_KEYWORD, COMPOSITE_KEYWORD OPTION, LEFT_PARENTHESIS, and RIGHT_PARENTHESIS.
The '\' character is used as escape. It can be used to escape '_', '%', '(' and '('.
Note that there is no EOS token returned.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescription(package private) final IEscapeUtil
(package private) final IEscapeUtil
(package private) final String
(package private) final int
(package private) int
(package private) TokenStream.TokenizerState
-
Constructor Summary
ConstructorsConstructorDescriptionTokenStream
(String pattern) TokenStream
(String pattern, IEscapeUtil escapeUtil) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addValuedToken
(int type, StringBuffer buf, List<Token> tokenList) (package private) void
escape
(String escapeChars, StringBuffer buf) private void
handleFormatModifierState
(char c, List<Token> tokenList, StringBuffer buf) private void
handleKeywordState
(char c, List<Token> tokenList, StringBuffer buf) private void
handleLiteralState
(char c, List<Token> tokenList, StringBuffer buf) private void
handleRightParenthesisState
(char c, List<Token> tokenList, StringBuffer buf) (package private) void
optionEscape
(String escapeChars, StringBuffer buf) private void
processOption
(char c, List<Token> tokenList, StringBuffer buf) (package private) List
tokenize()
-
Field Details
-
pattern
-
patternLength
final int patternLength -
escapeUtil
-
optionEscapeUtil
-
state
-
pointer
int pointer
-
-
Constructor Details
-
TokenStream
TokenStream(String pattern) -
TokenStream
TokenStream(String pattern, IEscapeUtil escapeUtil)
-
-
Method Details
-
tokenize
- Throws:
ScanException
-
handleRightParenthesisState
-
processOption
- Throws:
ScanException
-
handleFormatModifierState
-
handleLiteralState
-
handleKeywordState
-
escape
-
optionEscape
-
addValuedToken
-