|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.netbeans.modules.vcscore.Variables
This class contains static methods for variable expansion.
Expand Bash style variables, e.g. ${USER}
, with some additional gramatic.
Field Summary | |
static String |
DIR
Relative path (from MODULE) to particular file. |
static String |
FILE
The name of a variable, whose value is set to the selected file name. |
static String |
FILE_IS_FOLDER
|
static String |
FILES
The name of a variable, whose value is set to the selected file names. |
static String |
FILES_IS_FOLDER
|
static String |
MAX_CMD_LENGTH
If this variable is defined, than it's value (should be integer) is supposed to be the maximum length of a command in the system. |
static String |
MIMETYPE
|
static String |
MODULE
Greatest common parent (GCP) of selected files. |
static String |
MPATHS
|
static String |
MSG_PROMPT_FOR_AUTO_EDIT
The content of this variable is taken as a message, that is used to ask whether the EDIT command should be executed. |
static String |
MSG_PROMPT_FOR_AUTO_LOCK
The content of this variable is taken as a message, that is used to ask whether the LOCK command should be executed. |
static String |
MULTIPLE_FILES
|
static String |
NUM_FILES
|
static String |
NUM_IMPORTANT_FILES
|
static String |
PATH
|
static String |
PATHS
|
static String |
QFILE
The name of a variable, whose value is set to the selected file name quoted by the value of the QUOTING variable. |
static String |
QFILES
The name of a variable, whose value is set to the selected file names each quoted by the value of the QUOTING variable and delimeted by spaces. |
static String |
QMPATHS
|
static String |
QPATH
|
static String |
QPATHS
|
static String |
SHOW_DEAD_FILES
When non-empty, the directory reader should read also files, which were deleted from the version control system, but their old revisions exist. |
static String |
TEMPORARY_FILE
This variable is defined only when used in the execution string and is filled with the full path to a temporary file, that is created and exists ONLY while the command is running. |
Method Summary | |
static String |
expand(Map tab,
String cmd,
boolean warnUndefVars)
Expand all occurences of ${ repeatetively. |
static String |
expandConditional(Map tab,
String cmd,
boolean warnUndefVars)
|
static String |
expandFast(Map tab,
String cmd,
boolean warnUndefVars)
Expand all occurences of ${VARIABLE_NAME} . |
static String |
expandKnownOnly(Map tab,
String cmd)
Expand (once) ${VARIABLE} variables in command only if they are known. |
static String |
expandOnce(Map tab,
String cmd,
boolean warnUndefVars)
Expand (once) ${VARIABLE} variables in command. |
static String |
expandVariable(Map tab,
String name,
boolean warnUndefVars)
|
static Set |
getContextVariablesNames()
Variable names that forms actual command execution target. |
static Map |
getDefaultVariablesMap()
|
static boolean |
needFurtherExpansion(String cmd)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String FILE
public static final String QFILE
public static final String FILES
public static final String QFILES
public static final String DIR
public static final String MODULE
public static final String PATH
public static final String QPATH
public static final String PATHS
public static final String QPATHS
public static final String MPATHS
public static final String QMPATHS
public static final String MIMETYPE
public static final String NUM_FILES
public static final String NUM_IMPORTANT_FILES
public static final String FILE_IS_FOLDER
public static final String FILES_IS_FOLDER
public static final String MULTIPLE_FILES
public static final String TEMPORARY_FILE
public static final String SHOW_DEAD_FILES
public static final String MSG_PROMPT_FOR_AUTO_EDIT
public static final String MSG_PROMPT_FOR_AUTO_LOCK
public static final String MAX_CMD_LENGTH
Method Detail |
public static Set getContextVariablesNames()
public static Map getDefaultVariablesMap()
public static String expand(Map tab, String cmd, boolean warnUndefVars)
${}
repeatetively.
Expand also conditionals like $[? ] []
[].
- Parameters:
tab
- a map holding (String)VARIABLE, (String)VALUE pairscmd
- Command with ${VAR}
sequences
- Returns:
- String with all variables expanded
public static String expandVariable(Map tab, String name, boolean warnUndefVars)
public static String expandFast(Map tab, String cmd, boolean warnUndefVars)
${VARIABLE_NAME}
.
It makes only one expansion cycle, no variables inside other variables are expanded.
tab
- Hashtable holding (String)VARIABLE, (String)VALUE pairscmd
- Command with ${VAR}
sequences
public static String expandConditional(Map tab, String cmd, boolean warnUndefVars)
public static boolean needFurtherExpansion(String cmd)
public static String expandOnce(Map tab, String cmd, boolean warnUndefVars)
Note that 'cmd' string is scanned only once.
Use needFurtherExpansion(java.lang.String)
function to see if it should
be called again.
tab
- Hashtable holding (String)VARIABLE=(String)VALUE pairscmd
- Command in which ${VAR} sequences
public static String expandKnownOnly(Map tab, String cmd)
Note that 'cmd' string is scanned only once.
tab
- Hashtable holding (String)VARIABLE=(String)VALUE pairscmd
- Command in which ${VAR} sequences
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |