public interface KeywordHandler
This interface must be implemented by classes that should be used as a
keyword handler for a Tokenizer
.
Tokenizer
,
TokenizerProperties
,
DataMapper
Modifier and Type | Method and Description |
---|---|
boolean |
hasKeywords()
This method can be used by a
Tokenizer implementation
for a fast detection if keyword matching must be performed at all. |
TokenizerProperty |
isKeyword(DataProvider dataProvider)
This method checks if the character range given through the
DataProvider comprises a keyword. |
boolean hasKeywords()
Tokenizer
implementation
for a fast detection if keyword matching must be performed at all. If the method
returns false
time-consuming preparations can be skipped.true
if there actually are pattern that can be tested
for a match, false
otherwise.TokenizerProperty isKeyword(DataProvider dataProvider) throws TokenizerException, java.lang.NullPointerException
DataProvider
comprises a keyword. An implementation should use
a TokenizerException
to report problems.dataProvider
- the source to get the data from, that are checkedTokenizerProperty
if a keyword could be
found, null
otherwiseTokenizerException
- generic exceptionjava.lang.NullPointerException
- if no DataProvider
is given