當前位置: 首頁>>代碼示例>>Java>>正文


Java Ascii.isLowerCase方法代碼示例

本文整理匯總了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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:21,代碼來源:ImportRewriteDisabler.java

示例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;
}
 
開發者ID:mikesamuel,項目名稱:closure-maven-plugin,代碼行數:25,代碼來源:Words.java

示例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;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:12,代碼來源:Naming.java

示例4: hasLowerCase

import com.google.common.base.Ascii; //導入方法依賴的package包/類
private boolean hasLowerCase() {
  for (char c : chars) {
    if (Ascii.isLowerCase(c)) {
      return true;
    }
  }
  return false;
}
 
開發者ID:zugzug90,項目名稱:guava-mock,代碼行數:9,代碼來源:BaseEncoding.java

示例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());
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:42,代碼來源:Encodings.java

示例6: isLowerCase

import com.google.common.base.Ascii; //導入方法依賴的package包/類
public static boolean isLowerCase(char c) {
    return Ascii.isLowerCase(c);
}
 
開發者ID:pitchpoint-solutions,項目名稱:sfs,代碼行數:4,代碼來源:NullSafeAscii.java


注:本文中的com.google.common.base.Ascii.isLowerCase方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。