|
GXPARSE hosted by | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ScanState
Control interface between an active Scanner
and an
action
invoked by the
Scanner
.
Warning: a ScanState
instance is undefined outside the
scope of the action method that received the instance as a parameter.
Method Summary | |
---|---|
boolean |
containsKey(String key)
Find out whether a particular key has been used to save a
value. |
CharSequence |
get(String key)
Get a CharSequence that has been
saved as the value
for a specific key . |
Map<String,CharSequence> |
getMap()
Get the map that supports saving
and retrieving character sequences as
temporary values. |
boolean |
isTerminationRequested()
Indicate whether the Scanner has been requested to stop. |
Writer |
out()
Get the default output destination of the Scanner . |
int |
outputStackSize()
Return the number of Appendable items pushed on stack. |
Appendable |
popOutput()
Restore the previous default output (optional operation). |
RuleList |
popRuleList()
Restore the previous scanning rules (optional operation). |
void |
pushOutput(Appendable appendable)
Temporarily change the default output (optional operation). |
void |
pushRuleList(RuleList ruleList)
Temporarily change the scanning rules (optional operation). |
CharSequence |
put(String key,
CharSequence value)
Save a CharSequence as the value associated with a
key . |
void |
requestTermination()
Request the Scanner to discontinue scanning at the end
of the action from
which this method has been invoked. |
int |
ruleListStackSize()
Return the number of RuleList items pushed on stack. |
Method Detail |
---|
void pushRuleList(RuleList ruleList)
Temporarily change the scanning rules (optional operation). The change
becomes effective when control returns from the currently active
ScanRule action
.
UnsupportedOperationException
- if not implemented
NullPointerException
- if ruleList
is nullRuleList popRuleList()
Restore the previous scanning rules (optional operation). The change
becomes effective when control returns from the currently active
ScanRule action
.
UnsupportedOperationException
- if not implemented
EmptyStackException
- if no rules are pushed.int ruleListStackSize()
Return the number of RuleList
items pushed on stack.
void pushOutput(Appendable appendable)
Temporarily change the default output (optional operation). The change becomes effective immediately.
If the currently active default output is a
Flushable
, it will be flushed before the new
default ouput is put on the output stack.
UnsupportedOperationException
- if not implemented
NullPointerException
- if appendable
is nullAppendable popOutput()
Restore the previous default output (optional operation). The change becomes effective immediately.
If the currently active default output is a
Flushable
, it will be flushed, before being
popped from the output stack.
UnsupportedOperationException
- if not implemented
EmptyStackException
- if no default output has been pushed.int outputStackSize()
Return the number of Appendable
items pushed on stack.
Writer out()
Get the default output destination of the Scanner
.
The close method
throws
UnsupportedOperationException
because the default output destination must remain available while the
Scanner
is running..
Scanner default output methods should not be invoked from outside the
action method
of a
ScanRule
. Doing so may cause an
IllegalStateException
.
CharSequence get(String key)
Get a CharSequence
that has been
saved
as the value
for a specific key
. All keys are cleared when a
ScanRule
completes an
action
.
NullPointerException
- if key
is null
IllegalArgumentException
- if no value has been set for the key
since the last time that all keys have been cleared.
IllegalStateException
- if invoked outside the scope of a
ScanRule action
CharSequence put(String key, CharSequence value)
Save a CharSequence
as the value associated with a
key
. Replaces any previous value saved against the same
key
. All keys are cleared when a
ScanRule
completes an
action
.
NullPointerException
- if any parameter is null
IllegalStateException
- if invoked outside the scope of a
ScanRule action
boolean containsKey(String key)
Find out whether a particular key
has been used to save a
value. All keys are cleared when a ScanRule
completes
an action
.
NullPointerException
- if key
is null
IllegalStateException
- if invoked outside the scope of a
ScanRule action
Map<String,CharSequence> getMap()
Get the map that supports
saving
and retrieving
character sequences as
temporary values.
void requestTermination()
Request the Scanner
to discontinue scanning at the end
of the action
from
which this method has been invoked.
boolean isTerminationRequested()
Indicate whether the Scanner
has been requested to stop.
This method is normally used only by implementors.
|
GXPARSE download | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |