public class Embed extends AbstractFaAction
FaAction
which embeds the matched input
into two fixed strings.Constructor and Description |
---|
Embed(java.lang.String pre,
java.lang.String post)
calls the 3 parameter constructor with
priority==0 . |
Embed(java.lang.String pre,
java.lang.String post,
int prio)
creates an
FaAction with the given priority which
embeds the matched text into the given strings. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object _o) |
int |
hashCode() |
void |
invoke(java.lang.StringBuilder out,
int start,
DfaRun runner)
is called by methods of
DfaRun in case of a
match. |
java.lang.String |
toString() |
mergeWith, setPriority
public Embed(java.lang.String pre, java.lang.String post, int prio)
creates an FaAction
with the given priority which
embeds the matched text into the given strings. For example
new Embed("<x>", "</x>", 0)
arranges
for the match to be XML tagged with <x>
.
The parameters may not be null
, but may be the
empty string.
Although the functionality of this action is covered by the
more general Printf
, it is believed
that this specific implementation is slightly more efficient.
public Embed(java.lang.String pre, java.lang.String post)
calls the 3 parameter constructor with
priority==0
.
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
.
public boolean equals(java.lang.Object _o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object