本文整理汇总了Java中org.parboiled.common.StringUtils.isNotEmpty方法的典型用法代码示例。如果您正苦于以下问题:Java StringUtils.isNotEmpty方法的具体用法?Java StringUtils.isNotEmpty怎么用?Java StringUtils.isNotEmpty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.parboiled.common.StringUtils
的用法示例。
在下文中一共展示了StringUtils.isNotEmpty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: format
import org.parboiled.common.StringUtils; //导入方法依赖的package包/类
public String format(InvalidInputError error) {
if (error == null) return "";
int len = error.getEndIndex() - error.getStartIndex();
StringBuilder sb = new StringBuilder();
if (len > 0) {
char c = error.getInputBuffer().charAt(error.getStartIndex());
if (c == Chars.EOI) {
sb.append("Unexpected end of input");
} else {
sb.append("Invalid input '")
.append(StringUtils.escape(String.valueOf(c)));
if (len > 1) sb.append("...");
sb.append('\'');
}
} else {
sb.append("Invalid input");
}
String expectedString = getExpectedString(error);
if (StringUtils.isNotEmpty(expectedString)) {
sb.append(", expected ").append(expectedString);
}
return sb.toString();
}
示例2: visit
import org.parboiled.common.StringUtils; //导入方法依赖的package包/类
public void visit(RefLinkNode refLinkNode) {
// TODO reference link require implement
// to expand sentence
String linkName = printChildrenToString(refLinkNode);
String url = getRefLinkUrl(refLinkNode.referenceKey, linkName);
// FIXME how to handle url, if linkName include period character?
// TODO temporary implementation
if (candidateSentences.size() == 0) { return; }
CandidateSentence lastCandidateSentence =
candidateSentences.get(candidateSentences.size() - 1);
if (StringUtils.isNotEmpty(url)) {
lastCandidateSentence.setLink(url);
} else {
lastCandidateSentence.setContent(
lastCandidateSentence.getContent());
}
}
示例3: encode
import org.parboiled.common.StringUtils; //导入方法依赖的package包/类
public static String encode(String string) {
if (StringUtils.isNotEmpty(string)) {
for (int i = 0; i < string.length(); i++) {
if (encode(string.charAt(i)) != null) {
// we have at least one character that needs encoding, so do
// it one by one
StringBuilder sb = new StringBuilder();
for (i = 0; i < string.length(); i++) {
char c = string.charAt(i);
String encoded = encode(c);
if (encoded != null)
sb.append(encoded);
else
sb.append(c);
}
return sb.toString();
}
}
return string;
} else
return "";
}
示例4: update
import org.parboiled.common.StringUtils; //导入方法依赖的package包/类
private void update(String str) {
if (StringUtils.isNotEmpty(str)) {
int len = str.length();
ensureRemaining(len * 2);
for (int i = 0; i < len; i++) {
buffer.putChar(str.charAt(i));
}
}
}