本文整理汇总了Java中org.kohsuke.args4j.spi.Messages类的典型用法代码示例。如果您正苦于以下问题:Java Messages类的具体用法?Java Messages怎么用?Java Messages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Messages类属于org.kohsuke.args4j.spi包,在下文中一共展示了Messages类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: SearchTester
import org.kohsuke.args4j.spi.Messages; //导入依赖的package包/类
public SearchTester(String[] args) throws Exception {
CmdLineParser argparser = new CmdLineParser(this);
String home = null;
String ranker_name = null;
try {
argparser.parseArgument(args);
if (posargs.size() != 3) {
throw new CmdLineException(argparser, Messages.ILLEGAL_LIST, "Command line fail");
}
home = posargs.get(0);
ranker_name = posargs.get(1);
query_file = posargs.get(2);
if (home == null) {
throw new CmdLineException(argparser, Messages.ILLEGAL_PATH, "No home given");
}
if (ranker_name == null) {
throw new CmdLineException(argparser, Messages.ILLEGAL_OPERAND, "No ranker given");
}
if (query_file == null) {
throw new CmdLineException(argparser, Messages.ILLEGAL_PATH, "No query file given");
}
} catch (CmdLineException cle) {
System.err.println(cle.getMessage());
argparser.printUsage(System.err);
System.err.println();
}
fbs = new FreebaseSearcher(new FreebaseIndexer(home));
Class myClass = Class.forName(ranker_name);
Class[] types = {IndexSearcher.class, Analyzer.class, Integer.TYPE};
Constructor constructor = myClass.getConstructor(types);
ranker = (Ranker)constructor.newInstance(fbs.getIndexSearcher(), fbs.fbi.getIndexAnalyzer(), search_depth);
}
开发者ID:isoboroff,项目名称:basekb-search,代码行数:38,代码来源:SearchTester.java
示例2: parse
import org.kohsuke.args4j.spi.Messages; //导入依赖的package包/类
@Override
public ImmutablePair parse(String argument) throws CmdLineException, NumberFormatException {
String[] typeParams = argument.split(":");
if (typeParams.length != 2)
throw new CmdLineException(owner, Messages.ILLEGAL_OPERAND, option.toString(), argument);
Split type = null;
for (Split o : Split.class.getEnumConstants())
if (o.name().equalsIgnoreCase(typeParams[0])) {
type = o;
break;
}
List<Integer> parameters = new ArrayList<>();
try {
for (String p : typeParams[1].split(",")) {
parameters.add(Integer.parseInt(p));
}
} catch (NumberFormatException e) {
throw new CmdLineException(owner, Messages.ILLEGAL_OPERAND, option.toString(), argument);
}
if (type == null || parameters.size() == 0) {
throw new CmdLineException(owner, Messages.ILLEGAL_OPERAND, option.toString(), argument);
}
return new ImmutablePair(type, typeParams[1]);
}
开发者ID:fusepoolP3,项目名称:p3-batchrefine,代码行数:32,代码来源:SplitOptionHandler.java
示例3: parse
import org.kohsuke.args4j.spi.Messages; //导入依赖的package包/类
@Override
protected SetteToolConfiguration parse(@NonNull String toolName)
throws NumberFormatException, CmdLineException {
Optional<SetteToolConfiguration> toolConfig = configuration.getToolConfigurations()
.stream()
.filter(tc -> tc.getName().equalsIgnoreCase(toolName))
.findAny();
if (toolConfig.isPresent()) {
return toolConfig.get();
} else {
throw new CmdLineException(owner, Messages.ILLEGAL_OPERAND, option.toString(),
toolName);
}
}
开发者ID:SETTE-Testing,项目名称:sette-tool,代码行数:16,代码来源:ToolOptionHandler.java
示例4: parse
import org.kohsuke.args4j.spi.Messages; //导入依赖的package包/类
@Override
protected Integer parse(@NonNull String time) throws NumberFormatException, CmdLineException {
if (time.endsWith("ms")) {
return Integer.parseInt(time.substring(0, time.length() - 2));
} else if (time.endsWith("s")) {
return Integer.parseInt(time.substring(0, time.length() - 1)) * 1000;
} else {
throw new CmdLineException(owner, Messages.ILLEGAL_OPERAND, option.toString(), time);
}
}
开发者ID:SETTE-Testing,项目名称:sette-tool,代码行数:11,代码来源:TimeInMsOptionHandler.java
示例5: getDefaultMetaVariable
import org.kohsuke.args4j.spi.Messages; //导入依赖的package包/类
@Override
public String getDefaultMetaVariable()
{
return Messages.DEFAULT_META_STRING_ARRAY_OPTION_HANDLER.format();
}
开发者ID:verivital,项目名称:hyst,代码行数:6,代码来源:SplittingElementArrayOptionHandler.java
示例6: getDefaultMetaVariable
import org.kohsuke.args4j.spi.Messages; //导入依赖的package包/类
/**
* Returns {@code "STRING[]"}.
*
* @return return "STRING[]";
*/
@Override
public String getDefaultMetaVariable()
{
return Messages.DEFAULT_META_STRING_ARRAY_OPTION_HANDLER.format();
}
开发者ID:verivital,项目名称:hyst,代码行数:11,代码来源:StringPairsWithSpacesArrayOptionHandler.java
示例7: getDefaultMetaVariable
import org.kohsuke.args4j.spi.Messages; //导入依赖的package包/类
/**
* Returns {@code "STRING[]"}.
*
* @return return "STRING[]";
*/
@Override
public String getDefaultMetaVariable() {
return Messages.DEFAULT_META_STRING_ARRAY_OPTION_HANDLER.format();
}
开发者ID:facebook,项目名称:buck,代码行数:10,代码来源:QueryMultiSetOptionHandler.java
注:本文中的org.kohsuke.args4j.spi.Messages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论