类 Inflection
java.lang.Object
net.entframework.kernel.db.generator.utils.Inflection
Implementation of Rails' Inflections
to handle singularization and pluralization of 'Rails strings'.
Copied from rogueweb's port of Rails
to Java.
-
构造器概要
构造器构造器说明Inflection(String pattern) Inflection(String pattern, String replacement) Inflection(String pattern, String replacement, boolean ignoreCase) -
方法概要
修饰符和类型方法说明static booleanisUncountable(String word) Return true if the word is uncountable.booleanDoes the given word match?static StringReturn the pluralized version of a word.Replace the word with its pattern.static Stringsingularize(String word) Return the singularized version of a word.
-
构造器详细资料
-
Inflection
-
Inflection
-
Inflection
-
-
方法详细资料
-
match
Does the given word match?- 参数:
word- The word- 返回:
- True if it matches the inflection pattern
-
replace
Replace the word with its pattern.- 参数:
word- The word- 返回:
- The result
-
pluralize
Return the pluralized version of a word.- 参数:
word- The word- 返回:
- The pluralized word
-
singularize
Return the singularized version of a word.- 参数:
word- The word- 返回:
- The singularized word
-
isUncountable
Return true if the word is uncountable.- 参数:
word- The word- 返回:
- True if it is uncountable
-