Interface ITokenizer
- All Known Implementing Classes:
AbstractTokenizer
,CsvTokenizer
,ExpressionTokenizer
,GenericTokenizer
,MustacheTokenizer
public interface ITokenizer
-
Method Summary
Modifier and TypeMethodDescriptionA token state to process comments.Decodes quoted strings.Merges whitespaces.A token state to process numbers.A token state to process quoted strings.The stream scanner to tokenize.Skips comments.Skips End-Of-File token at the end of stream.Skip unknown charactersSkips whitespaces.A token state to process symbols (single like "=" or muti-character like "<>")Unifies numbers: "Integers" and "Floats" makes just "Numbers"A token state to process white space delimiters.A token state to process words or indentificators.Checks if there is the next token exist.Gets the next token from the scanner.void
setCommentState
(ICommentState value) A token state to process comments.void
setDecodeStrings
(boolean value) Decodes quoted strings.void
setMergeWhitespaces
(boolean value) Merges whitespaces.void
setNumberState
(INumberState value) A token state to process numbers.void
setQuoteState
(IQuoteState value) A token state to process quoted strings.void
setScanner
(IScanner scanner) The stream scanner to tokenize.void
setSkipComments
(boolean value) Skips comments.void
setSkipEof
(boolean value) Skips End-Of-File token at the end of stream.void
setSkipUnknown
(boolean value) Skip unknown charactersvoid
setSkipWhitespaces
(boolean value) Skips whitespaces.void
setSymbolState
(ISymbolState value) A token state to process symbols (single like "=" or muti-character like "<>")void
setUnifyNumbers
(boolean value) Unifies numbers: "Integers" and "Floats" makes just "Numbers"void
A token state to process white space delimiters.void
setWordState
(IWordState value) A token state to process words or indentificators.tokenizeBuffer
(String buffer) Tokenizes a string buffer into a list of tokens structures.tokenizeBufferToStrings
(String buffer) Tokenizes a string buffer into a list of strings.tokenizeStream
(IScanner scanner) Tokenizes a textual stream into a list of token structures.tokenizeStreamToStrings
(IScanner scanner) Tokenizes a textual stream into a list of strings.
-
Method Details
-
getSkipUnknown
Boolean getSkipUnknown()Skip unknown characters -
setSkipUnknown
void setSkipUnknown(boolean value) Skip unknown characters -
getSkipWhitespaces
Boolean getSkipWhitespaces()Skips whitespaces. -
setSkipWhitespaces
void setSkipWhitespaces(boolean value) Skips whitespaces. -
getSkipComments
Boolean getSkipComments()Skips comments. -
setSkipComments
void setSkipComments(boolean value) Skips comments. -
getSkipEof
Boolean getSkipEof()Skips End-Of-File token at the end of stream. -
setSkipEof
void setSkipEof(boolean value) Skips End-Of-File token at the end of stream. -
getMergeWhitespaces
Boolean getMergeWhitespaces()Merges whitespaces. -
setMergeWhitespaces
void setMergeWhitespaces(boolean value) Merges whitespaces. -
getUnifyNumbers
Boolean getUnifyNumbers()Unifies numbers: "Integers" and "Floats" makes just "Numbers" -
setUnifyNumbers
void setUnifyNumbers(boolean value) Unifies numbers: "Integers" and "Floats" makes just "Numbers" -
getDecodeStrings
Boolean getDecodeStrings()Decodes quoted strings. -
setDecodeStrings
void setDecodeStrings(boolean value) Decodes quoted strings. -
getCommentState
ICommentState getCommentState()A token state to process comments. -
setCommentState
A token state to process comments. -
getNumberState
INumberState getNumberState()A token state to process numbers. -
setNumberState
A token state to process numbers. -
getQuoteState
IQuoteState getQuoteState()A token state to process quoted strings. -
setQuoteState
A token state to process quoted strings. -
getSymbolState
ISymbolState getSymbolState()A token state to process symbols (single like "=" or muti-character like "<>") -
setSymbolState
A token state to process symbols (single like "=" or muti-character like "<>") -
getWhitespaceState
IWhitespaceState getWhitespaceState()A token state to process white space delimiters. -
setWhitespaceState
A token state to process white space delimiters. -
getWordState
IWordState getWordState()A token state to process words or indentificators. -
setWordState
A token state to process words or indentificators. -
getScanner
IScanner getScanner()The stream scanner to tokenize. -
setScanner
The stream scanner to tokenize. -
hasNextToken
Checks if there is the next token exist.- Returns:
true
if scanner has the next token.- Throws:
Exception
-
nextToken
Gets the next token from the scanner.- Returns:
- Next token of
null
if there are no more tokens left. - Throws:
Exception
-
tokenizeStream
Tokenizes a textual stream into a list of token structures.- Parameters:
scanner
- A textual stream to be tokenized.- Returns:
- A list of token structures.
- Throws:
Exception
-
tokenizeBuffer
Tokenizes a string buffer into a list of tokens structures.- Parameters:
buffer
- A string buffer to be tokenized.- Returns:
- A list of token structures.
- Throws:
Exception
-
tokenizeStreamToStrings
Tokenizes a textual stream into a list of strings.- Parameters:
scanner
- A textual stream to be tokenized.- Returns:
- A list of token strings.
- Throws:
Exception
-
tokenizeBufferToStrings
Tokenizes a string buffer into a list of strings.- Parameters:
buffer
- A string buffer to be tokenized.- Returns:
- A list of token strings.
- Throws:
Exception
-