当前位置: 首页>>代码示例>>Java>>正文


Java DebugPlugin.parseArguments方法代码示例

本文整理汇总了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());
}
 
开发者ID:Microsoft,项目名称:java-debug,代码行数:20,代码来源:AdvancedLaunchingConnector.java

示例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;
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:31,代码来源:LaunchConfigurationProcessorUtilities.java


注:本文中的org.eclipse.debug.core.DebugPlugin.parseArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。