本文整理汇总了Java中org.eclipse.debug.core.DebugPlugin.parseArguments方法的典型用法代码示例。如果您正苦于以下问题:Java DebugPlugin.parseArguments方法的具体用法?Java DebugPlugin.parseArguments怎么用?Java DebugPlugin.parseArguments使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.DebugPlugin
的用法示例。
在下文中一共展示了DebugPlugin.parseArguments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: constructLaunchCommand
import org.eclipse.debug.core.DebugPlugin; //导入方法依赖的package包/类
private static String[] constructLaunchCommand(Map<String, ? extends Argument> launchingOptions, String address) {
final String javaHome = launchingOptions.get(DebugUtility.HOME).value();
final String javaExec = launchingOptions.get(DebugUtility.EXEC).value();
final String slash = System.getProperty("file.separator");
boolean suspend = Boolean.valueOf(launchingOptions.get(DebugUtility.SUSPEND).value());
final String javaOptions = launchingOptions.get(DebugUtility.OPTIONS).value();
final String main = launchingOptions.get(DebugUtility.MAIN).value();
StringBuilder execString = new StringBuilder();
execString.append("\"" + javaHome + slash + "bin" + slash + javaExec + "\"");
execString.append(" -Xdebug -Xnoagent -Djava.compiler=NONE");
execString.append(" -Xrunjdwp:transport=dt_socket,address=" + address + ",server=n,suspend=" + (suspend ? "y" : "n"));
if (javaOptions != null) {
execString.append(" " + javaOptions);
}
execString.append(" " + main);
return DebugPlugin.parseArguments(execString.toString());
}
示例2: parseArgs
import org.eclipse.debug.core.DebugPlugin; //导入方法依赖的package包/类
/**
* Parses the arguments string into a list of arguments. This takes care of
* removing quoted arguments (for example, if an argument has a space.)
* <p>
* Any double-quotes that need to be preserved should be escaped (for example,
* "arg\\\"1 arg2", where a list consisting of "arg\"1" and "arg2" will be
* returned.) Any double-quotes that are not escaped will be treated as
* grouping e.g. white-space separated words into a single arg. Note that
* {@link #createArgsString(List)} will properly escape when assembling a
* single arg string from a list of args (the opposite of this method.)
*/
public static List<String> parseArgs(String args) {
List<String> argsList = new ArrayList<String>();
String[] argsArray = DebugPlugin.parseArguments(args);
if (Platform.getOS().equals(Constants.OS_WIN32)) {
/*
* On Windows, DebugPlugin.parseArguments escapes embedded quotes, but for
* other platforms, it does not. Undo this Windows-specific behavior since
* we will re-escape the quotes when creating a single args string from a
* list of args.
*/
for (int i = 0; i < argsArray.length; i++) {
argsArray[i] = argsArray[i].replaceAll("\\\\\\\"", "\"");
}
}
argsList.addAll(Arrays.asList(argsArray));
return argsList;
}