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 voidaddValuedToken(int type, StringBuffer buf, List<Token> tokenList) (package private) voidescape(String escapeChars, StringBuffer buf) private voidhandleFormatModifierState(char c, List<Token> tokenList, StringBuffer buf) private voidhandleKeywordState(char c, List<Token> tokenList, StringBuffer buf) private voidhandleLiteralState(char c, List<Token> tokenList, StringBuffer buf) private voidhandleRightParenthesisState(char c, List<Token> tokenList, StringBuffer buf) (package private) voidoptionEscape(String escapeChars, StringBuffer buf) private voidprocessOption(char c, List<Token> tokenList, StringBuffer buf) (package private) Listtokenize()
-
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
-