本文整理汇总了Java中jline.console.completer.ArgumentCompleter.ArgumentList类的典型用法代码示例。如果您正苦于以下问题:Java ArgumentList类的具体用法?Java ArgumentList怎么用?Java ArgumentList使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArgumentList类属于jline.console.completer.ArgumentCompleter包,在下文中一共展示了ArgumentList类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: escapedQuotes
import jline.console.completer.ArgumentCompleter.ArgumentList; //导入依赖的package包/类
@Test
public void escapedQuotes() throws Exception {
String s = "\\'a b";
ArgumentList argumentList = this.delimiter.delimit(s, 0);
assertThat(argumentList.getArguments()).isEqualTo(new String[] { "\\'a", "b" });
assertThat(this.delimiter.parseArguments(s)).containsExactly("'a", "b");
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:8,代码来源:EscapeAwareWhiteSpaceArgumentDelimiterTests.java
示例2: escapedQuotes
import jline.console.completer.ArgumentCompleter.ArgumentList; //导入依赖的package包/类
@Test
public void escapedQuotes() throws Exception {
String s = "\\'a b";
ArgumentList argumentList = this.delimiter.delimit(s, 0);
assertThat(argumentList.getArguments(), equalTo(new String[] { "\\'a", "b" }));
assertThat(this.delimiter.parseArguments(s), equalTo(new String[] { "'a", "b" }));
}
示例3: parseCursorArgument
import jline.console.completer.ArgumentCompleter.ArgumentList; //导入依赖的package包/类
private CursorArgument parseCursorArgument(String buffer, int cursor) {
CursorArgument result = new CursorArgument();
if (buffer != null && buffer.length() >= cursor) {
String buf = buffer.substring(0, cursor);
if (StringUtils.isNotBlank(buf)) {
ArgumentList argumentList = sqlDelimiter.delimit(buf, cursor);
String cursorArgument = argumentList.getCursorArgument();
if (cursorArgument != null) {
int pointPos1 = cursorArgument.indexOf('.');
int pointPos2 = cursorArgument.indexOf('.', pointPos1 + 1);
if (pointPos1 > -1) {
result.setSchema(cursorArgument.substring(0, pointPos1).trim());
if (pointPos2 > -1) {
result.setTable(cursorArgument.substring(pointPos1 + 1, pointPos2));
result.setColumn(cursorArgument.substring(pointPos2 + 1));
result.setCursorPosition(cursor - pointPos2 - 1);
} else {
result.setTable(cursorArgument.substring(pointPos1 + 1));
result.setCursorPosition(cursor - pointPos1 - 1);
}
}
}
}
}
return result;
}
示例4: parseArguments
import jline.console.completer.ArgumentCompleter.ArgumentList; //导入依赖的package包/类
public String[] parseArguments(String line) {
ArgumentList delimit = delimit(line, 0);
return cleanArguments(delimit.getArguments());
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:5,代码来源:EscapeAwareWhiteSpaceArgumentDelimiter.java