类 Inflection

java.lang.Object
net.entframework.kernel.db.generator.utils.Inflection

public class Inflection extends Object
Implementation of Rails' Inflections to handle singularization and pluralization of 'Rails strings'. Copied from rogueweb's port of Rails to Java.
  • 构造器详细资料

    • Inflection

      public Inflection(String pattern)
    • Inflection

      public Inflection(String pattern, String replacement)
    • Inflection

      public Inflection(String pattern, String replacement, boolean ignoreCase)
  • 方法详细资料

    • match

      public boolean match(String word)
      Does the given word match?
      参数:
      word - The word
      返回:
      True if it matches the inflection pattern
    • replace

      public String replace(String word)
      Replace the word with its pattern.
      参数:
      word - The word
      返回:
      The result
    • pluralize

      public static String pluralize(String word)
      Return the pluralized version of a word.
      参数:
      word - The word
      返回:
      The pluralized word
    • singularize

      public static String singularize(String word)
      Return the singularized version of a word.
      参数:
      word - The word
      返回:
      The singularized word
    • isUncountable

      public static boolean isUncountable(String word)
      Return true if the word is uncountable.
      参数:
      word - The word
      返回:
      True if it is uncountable