本文整理了Java中org.kohsuke.args4j.spi.Parameters.size()
方法的一些代码示例,展示了Parameters.size()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parameters.size()
方法的具体详情如下:
包路径:org.kohsuke.args4j.spi.Parameters
类名称:Parameters
方法名:size
[英]Number of remaining tokens.
[中]剩余代币的数量。
代码示例来源:origin: kohsuke/args4j
@Override
public int size() {
return params.size()-1;
}
});
代码示例来源:origin: args4j/args4j
@Override
public int size() {
return params.size()-1;
}
});
代码示例来源:origin: kohsuke/args4j
public int parseArguments(Parameters parameters) throws CmdLineException {
for (int i=0; i<parameters.size(); i++)
setter.addValue(parameters.getParameter(i));
return parameters.size();
}
代码示例来源:origin: args4j/args4j
public int parseArguments(Parameters parameters) throws CmdLineException {
for (int i=0; i<parameters.size(); i++)
setter.addValue(parameters.getParameter(i));
return parameters.size();
}
代码示例来源:origin: kohsuke/args4j
/**
* Tries to parse {@code String[]} argument from {@link Parameters}.
*/
@Override
public int parseArguments(Parameters params) throws CmdLineException {
int counter=0;
for (; counter<params.size(); counter++) {
String param = params.getParameter(counter);
if(param.startsWith("-")) {
break;
}
for (String p : param.split(" ")) {
setter.addValue(p);
}
}
return counter;
}
代码示例来源:origin: args4j/args4j
/**
* Tries to parse {@code String[]} argument from {@link Parameters}.
*/
@Override
public int parseArguments(Parameters params) throws CmdLineException {
int counter=0;
for (; counter<params.size(); counter++) {
String param = params.getParameter(counter);
if(param.startsWith("-")) {
break;
}
for (String p : param.split(" ")) {
setter.addValue(p);
}
}
return counter;
}
代码示例来源:origin: kohsuke/args4j
@Override
public int parseArguments(Parameters params) throws CmdLineException {
// end of arg list or next arg is another option
if ((params.size() == 0) || params.getParameter(0).startsWith("-")) {
setter.addValue(TRUE);
return 0;
} else {
setter.addValue(getBoolean(params.getParameter(0)));
return 1;
}
}
代码示例来源:origin: args4j/args4j
@Override
public int parseArguments(Parameters params) throws CmdLineException {
// end of arg list or next arg is another option
if ((params.size() == 0) || params.getParameter(0).startsWith("-")) {
setter.addValue(TRUE);
return 0;
} else {
setter.addValue(getBoolean(params.getParameter(0)));
return 1;
}
}
代码示例来源:origin: kohsuke/args4j
@Override
public int parseArguments(Parameters params) throws CmdLineException {
String subCmd = params.getParameter(0);
for (SubCommand c : commands.value()) {
if (c.name().equals(subCmd)) {
setter.addValue(subCommand(c,params));
return params.size(); // consume all the remaining tokens
}
}
return fallback(subCmd);
}
代码示例来源:origin: args4j/args4j
@Override
public int parseArguments(Parameters params) throws CmdLineException {
String subCmd = params.getParameter(0);
for (SubCommand c : commands.value()) {
if (c.name().equals(subCmd)) {
setter.addValue(subCommand(c,params));
return params.size(); // consume all the remaining tokens
}
}
return fallback(subCmd);
}
代码示例来源:origin: Nextdoor/bender
@Override
public int size() {
return params.size()-1;
}
});
代码示例来源:origin: org.jacoco/org.jacoco.cli
@Override
public int size() {
return params.size() - 1;
}
});
代码示例来源:origin: Nextdoor/bender
public int parseArguments(Parameters parameters) throws CmdLineException {
for (int i=0; i<parameters.size(); i++)
setter.addValue(parameters.getParameter(i));
return parameters.size();
}
代码示例来源:origin: CoreMedia/jangaroo-tools
@Override
public int parseArguments(Parameters parameters) throws CmdLineException {
List<File> sourceFiles = new ArrayList<File>(parameters.size());
for(int i = 0; i<parameters.size(); i++) {
String sourcePath = parameters.getParameter(i);
// be tolerant, accept also '/' as file separator
File sourceFile = new File(sourcePath.replace('/', File.separatorChar));
if (!sourceFile.exists()) {
throw new CmdLineException(owner, "Source file does not exist: " + sourceFile.getAbsolutePath());
}
sourceFiles.add(sourceFile);
}
setter.addValue(sourceFiles);
return parameters.size();
}
代码示例来源:origin: angular/clutz
@Override
public int parseArguments(Parameters params) throws CmdLineException {
final int paramsSize = params.size();
for (int i = 0; i < paramsSize; i++) {
String param = params.getParameter(i);
if (param.startsWith("-")) {
return i;
}
setter.addValue(param);
}
return paramsSize;
}
}
代码示例来源:origin: org.bitbucket.ibencher/vagabond
@Override
public int parseArguments(Parameters params) throws CmdLineException {
if (params.size() != 1)
throw new CmdLineException ("an option of type log level should have one parameter [trace,debug,info,warn,error,fatal,off]");
Level result = Level.toLevel(params.getParameter(0).toLowerCase());
setter.addValue(result);
log.debug("set log level " + result);
return 1;
}
代码示例来源:origin: Nextdoor/bender
/**
* Tries to parse {@code String[]} argument from {@link Parameters}.
*/
@Override
public int parseArguments(Parameters params) throws CmdLineException {
int counter=0;
for (; counter<params.size(); counter++) {
String param = params.getParameter(counter);
if(param.startsWith("-")) {
break;
}
for (String p : param.split(" ")) {
setter.addValue(p);
}
}
return counter;
}
代码示例来源:origin: Nextdoor/bender
@Override
public int parseArguments(Parameters params) throws CmdLineException {
// end of arg list or next arg is another option
if ((params.size() == 0) || params.getParameter(0).startsWith("-")) {
setter.addValue(TRUE);
return 0;
} else {
setter.addValue(getBoolean(params.getParameter(0)));
return 1;
}
}
代码示例来源:origin: Nextdoor/bender
@Override
public int parseArguments(Parameters params) throws CmdLineException {
String subCmd = params.getParameter(0);
for (SubCommand c : commands.value()) {
if (c.name().equals(subCmd)) {
setter.addValue(subCommand(c,params));
return params.size(); // consume all the remaining tokens
}
}
return fallback(subCmd);
}
代码示例来源:origin: org.jacoco/org.jacoco.cli
@Override
public int parseArguments(final Parameters params) throws CmdLineException {
final String subCmd = params.getParameter(0);
for (final Command c : AllCommands.get()) {
if (c.name().equals(subCmd)) {
parseSubArguments(c, params);
setter.addValue(c);
return params.size(); // consume all the remaining tokens
}
}
throw new CmdLineException(owner,
Messages.ILLEGAL_OPERAND.format(option.toString(), subCmd));
}
内容来源于网络,如有侵权,请联系作者删除!