public interface DataMapper extends WhitespaceHandler, SeparatorHandler, KeywordHandler, SequenceHandler, PatternHandler
This interface declares the methods that a Tokenizer
will call to detect the image and type of a token. Usually, an implementation
of the TokenizerProperties
interface should also
implement the DataMapper
interface, but this is not mandatory.
If a TokenizerProperties
instance given to a
Tokenizer
does not implement the DataMapper
interface, then the Tokenizer
will contruct a default DataMapper
for its properties.
This interface extends the SPI interfaces specialized in handling various token types.
Tokenizer
,
TokenizerProperties
PatternHandler.Result
Modifier and Type | Method and Description |
---|---|
TokenizerProperties |
getTokenizerProperties()
The method retrieves the backing
TokenizerProperties
instance, this DataMapper is working on. |
void |
setTokenizerProperties(TokenizerProperties props)
Setting the backing
TokenizerProperties instance
this DataMapper is working with. |
countLeadingWhitespaces, isWhitespace, newlineIsWhitespace
isSeparator
hasKeywords, isKeyword
getSequenceMaxLength, hasSequenceCommentOrString, startsWithSequenceCommentOrString
hasPattern, matches
void setTokenizerProperties(TokenizerProperties props) throws java.lang.UnsupportedOperationException, java.lang.NullPointerException
TokenizerProperties
instance
this DataMapper
is working with. Usually, the DataMapper
interface is implemented by TokenizerProperties
implementations,
too. Otherwise the Tokenizer
using the
TokenizerProperties
, will construct a default DataMapper
an propagate the TokenizerProperties
instance by calling this
method.
UnsupportedOperationException
if this DataMapper
is an extension to an TokenizerProperties
implementation.props
- the TokenizerProperties
java.lang.UnsupportedOperationException
- is this is a DataMapper
implemented by a TokenizerProperties
implementationjava.lang.NullPointerException
- if no TokenizerProperties
are givenTokenizerProperties getTokenizerProperties()
TokenizerProperties
instance, this DataMapper
is working on. For implementations
of the TokenizerProperties
interface that also implement the
DataMapper
interface, this method returns the instance itself.
TokenizerProperties
instance
passed through the last call to setTokenizerProperties(de.susebox.jtopas.TokenizerProperties)
or null
if no such call has taken place so far.TokenizerProperties
or null