|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjpicedt.format.input.util.AbstractRegularExpression
jpicedt.format.input.util.WordExpression
public class WordExpression
A RegExp that parses a word, that is, a string:
| Constructor Summary | |
|---|---|
WordExpression()
Parse an expression containing letters only, and stops when a non-letter char is found. |
|
WordExpression(String postfix,
boolean swallowPostFix)
Constructor with allowsDigit=false (i.e. only alphabetic character are swallowed if postfix = null), and which allows linefeeds. |
|
WordExpression(String postfix,
boolean swallowPostFix,
boolean allowDigit)
Allow line-feed's, i.e. expression may span more than one line. |
|
WordExpression(String postfix,
boolean swallowPostFix,
boolean allowDigit,
boolean noLineFeed)
|
|
| Method Summary | |
|---|---|
String |
getValue()
Return the parsed content of this expression after a successfull parsing. |
boolean |
interpret(Context context)
If parsing was successfull, sends a ParserEvent with value=string found (this may be an empty string) You may then use Context.removeLineFeeds(String) to remove CR from "value". |
String |
toString()
|
| Methods inherited from class jpicedt.format.input.util.AbstractRegularExpression |
|---|
action |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public WordExpression(String postfix,
boolean swallowPostFix,
boolean allowDigit,
boolean noLineFeed)
postfix - a String that signals the end of the word (if NULL, swallows as many letters as
possible)swallowPostFix - if TRUE, move cursor JUST BEHIND the postfix; else move it TO THE POSTFIX
POSITIONallowDigit - if TRUE, and postfix=NULL, swallows as many
"letter-or-digit" as possible (i.e. alphanumeric expression)noLineFeed - if true, expression must fit on a single line. Otherwise, it may span several lines.
public WordExpression(String postfix,
boolean swallowPostFix,
boolean allowDigit)
postfix - a String that signals the end of the word (if NULL, swallows as many letters as
possible)swallowPostFix - if TRUE, move cursor JUST BEHIND the postfix; else move it TO THE POSTFIX
POSITIONallowDigit - if TRUE, and postfix=NULL, swallows as many
"letter-or-digit" as possible (i.e. alphanumeric expression)
public WordExpression(String postfix,
boolean swallowPostFix)
postfix - a String that signals the end of the word (if NULL, swallows as many letters as
possible)swallowPostFix - if TRUE, move cursor JUST BEHIND the postfix; else move it TO THE POSTFIX
POSITIONpublic WordExpression()
| Method Detail |
|---|
public boolean interpret(Context context)
throws REParserException
You may then use Context.removeLineFeeds(String) to remove CR from "value".
interpret in class AbstractRegularExpressionREParserException - if an error occur during parsingpublic String getValue()
public String toString()
toString in class Object
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||