本文整理匯總了Java中com.google.common.base.Ascii.isLowerCase方法的典型用法代碼示例。如果您正苦於以下問題:Java Ascii.isLowerCase方法的具體用法?Java Ascii.isLowerCase怎麽用?Java Ascii.isLowerCase使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.google.common.base.Ascii
的用法示例。
在下文中一共展示了Ascii.isLowerCase方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: shouldDisableFor
import com.google.common.base.Ascii; //導入方法依賴的package包/類
private static boolean shouldDisableFor(Reporter reporter, Element element) {
while (element != null) {
if (element.getKind() == ElementKind.PACKAGE) {
for (String segment : DOT_SPLITTER.split(((PackageElement) element).getQualifiedName())) {
if (!segment.isEmpty() && Ascii.isUpperCase(segment.charAt(0))) {
reporter.warning(WARNING_START + " uppercase package names");
return true;
}
}
}
if (element.getKind().isClass() || element.getKind().isInterface()) {
if (Ascii.isLowerCase(element.getSimpleName().charAt(0))) {
reporter.warning(WARNING_START + " lowercase class names");
return true;
}
}
element = element.getEnclosingElement();
}
return false;
}
示例2: endsWithWordOrIs
import com.google.common.base.Ascii; //導入方法依賴的package包/類
/**
* True when s ends with suffix in a way that suffix is not part of a larger
* word by camel-casing or underscore naming conventions.
*/
public static boolean endsWithWordOrIs(String s, String suffix) {
if (suffix.isEmpty()) {
return true;
}
String lc = Ascii.toLowerCase(s);
if (lc.endsWith(suffix)) {
int beforeSuffix = lc.length() - suffix.length() - 1;
if (beforeSuffix < 0) {
return true;
}
if (!Character.isLetterOrDigit(lc.charAt(beforeSuffix))) {
return true;
}
if (Ascii.isLowerCase(s.charAt(beforeSuffix))
&& Ascii.isUpperCase(s.charAt(beforeSuffix + 1))) {
return true;
}
}
return false;
}
示例3: apply
import com.google.common.base.Ascii; //導入方法依賴的package包/類
public String apply(String input) {
if (!input.isEmpty()) {
if (this == CAPITALIZED && !Ascii.isUpperCase(input.charAt(0))) {
return CaseFormat.LOWER_CAMEL.to(CaseFormat.UPPER_CAMEL, input);
}
if (this == LOWERIZED && !Ascii.isLowerCase(input.charAt(0))) {
return CaseFormat.UPPER_CAMEL.to(CaseFormat.LOWER_CAMEL, input);
}
}
return input;
}
示例4: hasLowerCase
import com.google.common.base.Ascii; //導入方法依賴的package包/類
private boolean hasLowerCase() {
for (char c : chars) {
if (Ascii.isLowerCase(c)) {
return true;
}
}
return false;
}
示例5: processMember
import com.google.common.base.Ascii; //導入方法依賴的package包/類
private void processMember(Element member) {
if ((member.getKind() == ElementKind.FIELD
|| member.getKind() == ElementKind.METHOD)
&& !memberNames.add(memberPath(member))) {
reporter.withElement(member)
.error("Duplicate member name '%s'. Encoding has limitation so that any duplicate method names are not supported,"
+ " even when allowed by JLS: methods cannot have overloads here."
+ " @Encoding.Naming annotation could be used so that actually generated methods might have the same name"
+ " if they are not conflicting as per JLS overload rules",
member.getSimpleName());
return;
}
if (member.getKind() == ElementKind.FIELD) {
if (processField((VariableElement) member))
return;
}
if (member.getKind() == ElementKind.METHOD) {
if (!Ascii.isLowerCase(member.getSimpleName().charAt(0))) {
reporter.withElement(member)
.warning("Methods not starting with lowercase ascii letter might not work properly",
member.getSimpleName());
}
if (processMethod((ExecutableElement) member))
return;
}
if (member.getKind() == ElementKind.CLASS) {
if (processClass((TypeElement) member))
return;
}
if (member.getKind() == ElementKind.INSTANCE_INIT) {
return;
}
if (member.getSimpleName().contentEquals("<init>")) {
return;
}
reporter.withElement(member)
.warning("Unrecognized encoding member '%s' will be ignored", member.getSimpleName());
}
示例6: isLowerCase
import com.google.common.base.Ascii; //導入方法依賴的package包/類
public static boolean isLowerCase(char c) {
return Ascii.isLowerCase(c);
}