本文整理汇总了Java中org.eclipse.core.runtime.Platform.getApplicationArgs方法的典型用法代码示例。如果您正苦于以下问题:Java Platform.getApplicationArgs方法的具体用法?Java Platform.getApplicationArgs怎么用?Java Platform.getApplicationArgs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.runtime.Platform
的用法示例。
在下文中一共展示了Platform.getApplicationArgs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseDefaultXML
import org.eclipse.core.runtime.Platform; //导入方法依赖的package包/类
/**
* We ensure that the xml is parsed, if any
* Hopefully this has already been done by
* the client spring xml configuration but
* if not we check if there is an xml argument
* here and attempt to load its path.
* This step is done for testing and to make
* the example client work.
**/
public static final ControlTree parseDefaultXML() {
if (ControlTree.getInstance()!=null) return ControlTree.getInstance();
String[] args = Platform.getApplicationArgs();
for (int i = 0; i < args.length; i++) {
final String arg = args[i];
if (arg.equals("-xml")) {
String path = args[i+1];
ISpringParser parser = ServiceHolder.getSpringParser();
try {
parser.parse(path);
} catch (Exception e) {
logger.error("Unabled to parse: "+path, e);
}
break;
}
}
return ControlTree.getInstance();
}