public class Store extends AbstractFaAction
an FaAction
to store away the match in a
Map
. The map is obtained from the MapProvider
which must be stored in the DfaRun.clientData
field of the calling DfaRun
.
Constructor and Description |
---|
Store(java.lang.String key)
stores the match with the given
key in a map
obtained from a MapProvider expected to be found in the
DfaRun.clientData field of the calling
DfaRun object. |
Modifier and Type | Method and Description |
---|---|
void |
invoke(java.lang.StringBuilder out,
int start,
DfaRun runner)
is called by methods of
DfaRun in case of a
match. |
mergeWith, setPriority
public Store(java.lang.String key)
stores the match with the given key
in a map
obtained from a MapProvider
expected to be found in the
DfaRun.clientData
field of the calling
DfaRun
object. The match will not be deleted from
the output stream. Consider combining a Store
callback via a Run
with other callbacks to get a
different outcome.
public void invoke(java.lang.StringBuilder out, int start, DfaRun runner)
FaAction
is called by methods of DfaRun
in case of a
match. Parameter yytext
contains the matching text
from position start
onwards. The callback may change
the whole of yytext
, but the under most
circumstances, only the matching text should be
changed. Parameter runner
is the DfaRun
object which called this function. Of interest are its fields
DfaRun.clientData
and DfaRun.collect
.