public class CupArgumentTranslator extends CommandlineArgumentTranslator
| Modifier and Type | Field and Description |
|---|---|
protected String |
FLAG_CLASS
String representing the class flag.
|
protected String |
FLAG_ID
String representing the id flag.
|
protected String |
FLAG_PATH
String representing the path flag.
|
protected String |
FLAG_SYSTEMACL
String representing the systemacl flag.
|
protected String |
FLAG_USER
String representing the user flag.
|
protected String |
FLAG_VALUEDEFAULT
String representing the valuedefault flag.
|
protected static String |
PARAMETER_FLAGKEY
Name of the flagkey parameter in the hashtable.
|
protected static String |
PARAMETER_FLAGVALUE
Name of the flagvalue parameter in the hashtable.
|
protected static String |
PARAMETER_POSITIONAL
Name of the positional parameter in the hashtable.
|
CMDKEY| Constructor and Description |
|---|
CupArgumentTranslator() |
| Modifier and Type | Method and Description |
|---|---|
protected int[] |
getPotentialArgs()
Gets the argument type a particular flag is expecting.
|
protected String[] |
getPotentialFlags()
Gets the potentails flags that the
object might be expecting.
|
protected void |
handleFlag(String flagKey,
String flagValue,
CommandContext state,
Hashtable tstate)
Handles a flags and arguments in the command line.
|
protected void |
handlePositional(int pos,
String positional,
CommandContext state,
Hashtable tstate)
Handles the positionals that are common to several cup commands.
|
protected void |
initialize(CommandContext state,
Object invoker,
Hashtable tstate)
Initialize the argument translator.
|
protected LibraryObject[] |
resolveObject(LibrarySession session,
FolderPathResolver fpr,
Hashtable tstate,
boolean multipleObjectsAllowed)
This returns an array of LibraryObjects based on the flags and positionals.
|
parse, postParse, translateprotected static final String PARAMETER_FLAGKEY
protected static final String PARAMETER_POSITIONAL
protected static final String PARAMETER_FLAGVALUE
protected final String FLAG_CLASS
protected final String FLAG_ID
protected final String FLAG_PATH
protected final String FLAG_SYSTEMACL
protected final String FLAG_USER
protected final String FLAG_VALUEDEFAULT
protected void initialize(CommandContext state, Object invoker, Hashtable tstate) throws IfsException
initialize in class CommandlineArgumentTranslatorstate - instance of CommandContextinvoker - invoker of this command; usually CupServerChanneltstate - hashtable used to store flagsIfsException - if the operation failsprotected LibraryObject[] resolveObject(LibrarySession session, FolderPathResolver fpr, Hashtable tstate, boolean multipleObjectsAllowed) throws IfsException
session - the sessionfpr - resolver for folder pathststate - hashtable used to store flagsmultipleObjectsAllowed - if true, flags can resolve into multiple objectsIfsException - if the operation failsprotected void handlePositional(int pos,
String positional,
CommandContext state,
Hashtable tstate)
throws IfsException
handlePositional in class CommandlineArgumentTranslatorpos - positionpositional - the positionalstate - runtime command contexttstate - hashtable used to store flagsIfsException - if the operation failsprotected String[] getPotentialFlags()
getPotentialFlags in class CommandlineArgumentTranslatorprotected int[] getPotentialArgs()
getPotentialArgs in class CommandlineArgumentTranslatorprotected void handleFlag(String flagKey, String flagValue, CommandContext state, Hashtable tstate) throws IfsException
handleFlag in class CommandlineArgumentTranslatorflagKey - key used to identify the flag in the command lineflagValue - value of the flagstate - instance of CommandContext objecttstate - hashtable which stores parametersIfsException - if the operation failsCopyright © 2025. All rights reserved.