本文整理了Java中org.openide.util.Utilities.parseParameters()
方法的一些代码示例,展示了Utilities.parseParameters()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utilities.parseParameters()
方法的具体详情如下:
包路径:org.openide.util.Utilities
类名称:Utilities
方法名:parseParameters
[英]Parses parameters from a given string in shell-like manner. Users of the Bourne shell (e.g. on Unix) will already be familiar with the behavior. For example, when using org.openide.execution.NbProcessDescriptor
(Execution API) you should be able to:
c:\Program Files\jdk\bin\javac
.-Dname=value
.``
"c:\program files\jdk\bin\java" -Dmessage="Hello /\\/\\ there!" -Xmx128m
This example would create the following executable name and arguments:
c:\program files\jdk\bin\java
-Dmessage=Hello /\/\ there!
-Xmx128m
org.openide.execution.NbProcessDescriptor
(执行API)时,您应该能够:c:\Program Files\jdk\bin\javac
。"c:\program files\jdk\bin\java" -Dmessage="Hello /\\/\\ there!" -Xmx128m
此示例将创建以下可执行文件名和参数:
c:\program files\jdk\bin\java
-Dmessage=Hello /\/\ there!
-Xmx128m
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-platform
/**
* Arguments to be prepended <em>BEFORE</em> the target. Usually arguments
* and options for the Ruby interpreter.
*/
public String[] getInitialArgs() {
return initialArgs == null ? null : Utilities.parseParameters(initialArgs);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-platform
/** Arguments to be passed to the JVM running the JRuby process. */
public String[] getJVMArguments() {
return jvmArgs == null ? null : Utilities.parseParameters(jvmArgs);
}
代码示例来源:origin: org.netbeans.api/org-openide-execution
/** Parses given string to an array of arguments.
* @param sargs is tokenized by spaces unless a space is part of "" token
* @return tokenized string
*/
private static String[] parseArguments(String sargs) {
return Utilities.parseParameters(sargs);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-project
private List<String> getParams() {
List<String> params = new ArrayList<>();
if (StringUtils.hasText(phpArgs)) {
params.addAll(Arrays.asList(Utilities.parseParameters(phpArgs)));
}
params.add(file.getAbsolutePath());
if (StringUtils.hasText(fileArgs)) {
params.addAll(Arrays.asList(Utilities.parseParameters(fileArgs)));
}
return params;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject
public String[] getArgsArray() {
return Utilities.parseParameters(getArgsFlat());
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-project
protected String[] getApplicationArguments() {
String applicationArgs = project.evaluator().getProperty(SharedRubyProjectProperties.APPLICATION_ARGS);
return (applicationArgs == null || applicationArgs.trim().length() == 0)
? null : Utilities.parseParameters(applicationArgs);
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-framework
public CommandDescriptor(FrameworkCommand task, String params, boolean debug) {
Parameters.notNull("task", task);
Parameters.notNull("params", params);
this.task = task;
this.params = Utilities.parseParameters(params.trim());
this.debug = debug;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep
static Pair<String, List<String>> parseCommand(String command) {
if (command == null) {
// avoid NPE
command = ""; // NOI18N
}
// try to find program (search for " -" or " /" after space)
String[] tokens = command.split(" * (?=\\-|/)", 2); // NOI18N
if (tokens.length == 1) {
LOGGER.log(Level.FINE, "Only program given (no parameters): {0}", command);
return Pair.of(tokens[0].trim(), Collections.<String>emptyList());
}
Pair<String, List<String>> parsedCommand = Pair.of(tokens[0].trim(), Arrays.asList(Utilities.parseParameters(tokens[1].trim())));
LOGGER.log(Level.FINE, "Parameters parsed: {0} {1}", new Object[] {parsedCommand.first(), parsedCommand.second()});
return parsedCommand;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-debugger-common2
private String[] getDebugCommand() {
String command = DebuggerOption.DEBUG_COMMAND.getCurrValue(options);
if (config != null && config instanceof MakeConfiguration) {
return Utilities.parseParameters(
ProjectActionEvent.getRunCommandAsString(
command,
(MakeConfiguration) config,
NativeDebuggerImpl.getPathMapFromConfig(config)
)
);
} else {
return Utilities.parseParameters("");
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-php-api-executable
static Pair<String, List<String>> parseCommand(String command) {
if (command == null) {
// avoid NPE
command = ""; // NOI18N
}
// try to find program (search for " -" or " /" after space)
String[] tokens = command.split(" * (?=\\-|/)", 2); // NOI18N
if (tokens.length == 1) {
LOGGER.log(Level.FINE, "Only program given (no parameters): {0}", command);
return Pair.of(tokens[0].trim(), Collections.<String>emptyList());
}
Pair<String, List<String>> parsedCommand = Pair.of(tokens[0].trim(), Arrays.asList(Utilities.parseParameters(tokens[1].trim())));
LOGGER.log(Level.FINE, "Parameters parsed: {0} {1}", new Object[] {parsedCommand.first(), parsedCommand.second()});
return parsedCommand;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-css-prep
public static List<String> parseCompilerOptions(@NullAllowed String compilerOptions, @NullAllowed FileObject webRoot) {
if (!StringUtils.hasText(compilerOptions)) {
return Collections.emptyList();
}
String[] parsedCompilerParams = Utilities.parseParameters(processCompilerOptions(compilerOptions, webRoot));
return Arrays.asList(parsedCompilerParams);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd
shellCommand = ShellSettings.getDefault().getDefaultShellCommand();
argvParsed = Utilities.parseParameters(shellCommand);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-railsprojects
for (String arg : Utilities.parseParameters(extraArgs)) {
result.add(arg);
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-web-client-tools-common
NbProcessDescriptor newP = null;
String [] args = Utilities.parseParameters(p.getArguments());
if (args.length > 1) {
StringBuffer newArgs = new StringBuffer ();
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-docker-ui
String[] parsed = command == null ? new String[]{} : Utilities.parseParameters(command);
config.put("Image", getImage(tag));
JSONArray cmdArray = new JSONArray();
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-project
static void runTask(final RubyBaseProject project, final RakeTask task,
final String taskParams, final boolean debug) {
RakeRunner runner = new RakeRunner(project);
runner.showWarnings(true);
if (taskParams != null) {
runner.setParameters(Utilities.parseParameters(taskParams));
}
runner.setDebug(debug);
runner.run(task);
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-cnd-makeproject
private String[] getRunCommand() {
if (runCommandCache == null || runCommandCache.length == 0) {
// not clear what is the difference between getPlatformInfo
// and getDevelopmentHost.
// TODO: get rid off one of ifs below
assert(configuration.getPlatformInfo().isLocalhost() == configuration.getDevelopmentHost().isLocalhost());
runCommandCache = Utilities.parseParameters(getRunCommandAsString());
}
return runCommandCache;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-project
private void doRun(File file, RunFileArgs runFileArgs, boolean debug) {
File workDir = new File(runFileArgs.getWorkDir());
RubyExecutionDescriptor desc = new RubyExecutionDescriptor(runFileArgs.getPlatform(), file.getName(), workDir);
if (runFileArgs.getRunArgs() != null) {
desc.additionalArgs(Utilities.parseParameters(runFileArgs.getRunArgs()));
}
desc.jvmArguments(runFileArgs.getJvmArgs());
desc.initialArgs(runFileArgs.getRubyOpts());
desc.debug(debug);
desc.script(file.getAbsolutePath());
RubyProcessCreator rpc = new RubyProcessCreator(desc);
if (rpc.isAbleToCreateProcess()) {
ExecutionService.newService(rpc, desc.toExecutionDescriptor(), file.getName()).run();
}
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-project
String[] args = Utilities.parseParameters(extraArgs);
if (args != null) {
for (String arg : args) {
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-ruby-project
desc.additionalArgs(Utilities.parseParameters(args.getRunArgs()));
内容来源于网络,如有侵权,请联系作者删除!