|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objexcel.util.Alias
Alias complies and expands input strings against an alias. /aliasname text [$index[="variable name"]] text variable name:refers to a named variable you supply. If no variable is found, you'll be prompted for one. $index :the index refers to the n'th token on the command line supplied when expanding the alis $2- :indicates that everything following and including parameter 2 should be appended to the command line $2-4 : indicated user token 2 through four are substituted $-4 : indicated user token 0 (the alias name) through four are substituted $$1 : indicates this parameter is mandatory and the user will be prompted for a value if they don't enter one.
Inner Class Summary | |
static interface |
Alias.IFetchInput
IFetchInput specifies the interface for getting values to fill in from a set of arguments. |
static class |
Alias.ParsedAlias
ParsedAlias is the 'compiled' form of an alias (faster to expand this way) |
Constructor Summary | |
Alias()
|
Method Summary | |
static char[] |
convertToCharArray(java.lang.String s)
turn the string into an array of chars |
static java.lang.String |
dollarDelimitedText(char[] input,
int[] current)
null | anything but $ (\$ ok) |
static java.lang.String[] |
expand(java.lang.String[] tokens,
Alias.ParsedAlias parsedAlias,
java.lang.String target,
java.lang.String me,
Alias.IFetchInput inputFetcher)
use the compiled alias to expand a set of user tokens |
static java.lang.String[] |
getLines(char[] input,
int[] current)
split some text into lines. |
static java.lang.String[] |
nameValuePair(char[] input,
int[] current)
name=[value] returns String[] {name, value} |
static int |
number(char[] input,
int[] current)
(digit)* |
static int[] |
numberParameter(char[] input,
int[] current)
n-n -n n- |
static java.lang.Object[] |
parameter(char[] input,
int[] current)
$[$](numberParamter())[=quotedString()] |
static Alias.ParsedAlias |
parseAlias(java.lang.String name,
char[] input,
int[] current)
create a compiled alias out of the input |
static java.lang.String |
quotedString(char[] input,
int[] current,
char escape)
"quoted\"String" |
static java.lang.String |
readLine(char[] input,
int[] current)
return the next line of text. |
static java.lang.String |
remainder(char[] input,
int[] current)
return everthing from the current position on as a string null if nothing |
static java.lang.String |
slashName(char[] input,
int[] current)
[space]'/'name as in /j fred returns j |
static void |
space(char[] input,
int[] current)
|
static java.lang.String |
specialDelimitedToken(char[] input,
int[] current,
char escape,
char special,
boolean throwIfDelimiterNotFound,
boolean eatDelimiter)
returns the next special delimited token. |
static java.lang.String |
spRemainder(char[] input,
int[] current)
same as remainder but eats spaces first |
static java.lang.String |
spWord(char[] input,
int[] current)
spWord: [space()]word same as word but is ok if we have spaces leading in null if no token |
static java.lang.String[] |
tokenize(char[] input,
int[] current,
boolean isQuotedTextOneToken)
return a array of tokens. |
static java.lang.String |
word(char[] input,
int[] current)
word: ~' '(char ~[ ])* |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public Alias()
Method Detail |
public static char[] convertToCharArray(java.lang.String s)
public static java.lang.String[] expand(java.lang.String[] tokens, Alias.ParsedAlias parsedAlias, java.lang.String target, java.lang.String me, Alias.IFetchInput inputFetcher) throws java.text.ParseException
tokens
- are user entered tokens (0 = alias name, 1 = arg1, etc)alias
- a parsed alias to expand againsttarget
- who the command is aimed at (person, room or null)me
- the person making the command.inputFetcher
- gathers any missing argumentspublic static java.lang.String[] getLines(char[] input, int[] current)
public static java.lang.String[] tokenize(char[] input, int[] current, boolean isQuotedTextOneToken) throws java.text.ParseException
public static Alias.ParsedAlias parseAlias(java.lang.String name, char[] input, int[] current) throws java.text.ParseException
public static java.lang.String slashName(char[] input, int[] current) throws java.text.ParseException
public static void space(char[] input, int[] current) throws java.text.ParseException
public static java.lang.String word(char[] input, int[] current) throws java.text.ParseException
public static java.lang.String spWord(char[] input, int[] current)
public static java.lang.String remainder(char[] input, int[] current)
public static java.lang.String spRemainder(char[] input, int[] current)
public static java.lang.String dollarDelimitedText(char[] input, int[] current) throws java.text.ParseException
public static java.lang.Object[] parameter(char[] input, int[] current) throws java.text.ParseException
public static int[] numberParameter(char[] input, int[] current) throws java.text.ParseException
public static java.lang.String quotedString(char[] input, int[] current, char escape) throws java.text.ParseException
public static int number(char[] input, int[] current) throws java.text.ParseException
public static java.lang.String[] nameValuePair(char[] input, int[] current) throws java.text.ParseException
public static java.lang.String readLine(char[] input, int[] current)
public static java.lang.String specialDelimitedToken(char[] input, int[] current, char escape, char special, boolean throwIfDelimiterNotFound, boolean eatDelimiter) throws java.text.ParseException
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |