Class JavaBeansUtil

java.lang.Object
org.mybatis.generator.internal.util.JavaBeansUtil

public class JavaBeansUtil extends Object
  • Constructor Details

    • JavaBeansUtil

      private JavaBeansUtil()
  • Method Details

    • getGetterMethodName

      public static String getGetterMethodName(String property, FullyQualifiedJavaType fullyQualifiedJavaType)
      Computes a getter method name. Warning - does not check to see that the property is a valid property. Call getValidPropertyName first.
      Parameters:
      property - the property
      fullyQualifiedJavaType - the fully qualified java type
      Returns:
      the getter method name
    • getSetterMethodName

      public static String getSetterMethodName(String property)
      Computes a setter method name. Warning - does not check to see that the property is a valid property. Call getValidPropertyName first.
      Parameters:
      property - the property
      Returns:
      the setter method name
    • getFirstCharacterUppercase

      public static String getFirstCharacterUppercase(String inputString)
    • getCamelCaseString

      public static String getCamelCaseString(String inputString, boolean firstCharacterUppercase)
    • getValidPropertyName

      public static String getValidPropertyName(String inputString)
      This method ensures that the specified input string is a valid Java property name.

      The rules are as follows:

      1. If the first character is lower case, then OK
      2. If the first two characters are upper case, then OK
      3. If the first character is upper case, and the second character is lower case, then the first character should be made lower case

      For example:

      • eMail > eMail
      • firstName > firstName
      • URL > URL
      • XAxis > XAxis
      • a > a
      • B > b
      • Yaxis > yaxis
      Parameters:
      inputString - the input string
      Returns:
      the valid property name
    • getJavaBeansGetter

      public static Method getJavaBeansGetter(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable)
    • getJavaBeansGetterWithGeneratedAnnotation

      public static Method getJavaBeansGetterWithGeneratedAnnotation(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit)
    • getBasicJavaBeansGetter

      private static Method getBasicJavaBeansGetter(IntrospectedColumn introspectedColumn)
    • addGeneratedGetterJavaDoc

      private static void addGeneratedGetterJavaDoc(Method method, IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable)
    • addGeneratedGetterAnnotation

      private static void addGeneratedGetterAnnotation(Method method, IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit)
    • getJavaBeansField

      public static Field getJavaBeansField(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable)
    • getJavaBeansFieldWithGeneratedAnnotation

      public static Field getJavaBeansFieldWithGeneratedAnnotation(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit)
    • getBasicJavaBeansField

      private static Field getBasicJavaBeansField(IntrospectedColumn introspectedColumn)
    • addGeneratedJavaDoc

      private static void addGeneratedJavaDoc(Field field, Context context, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable)
    • addGeneratedAnnotation

      private static void addGeneratedAnnotation(Field field, Context context, IntrospectedColumn introspectedColumn, IntrospectedTable introspectedTable, CompilationUnit compilationUnit)
    • getJavaBeansSetter

      public static Method getJavaBeansSetter(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable)
    • getJavaBeansSetterWithGeneratedAnnotation

      public static Method getJavaBeansSetterWithGeneratedAnnotation(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit)
    • getBasicJavaBeansSetter

      private static Method getBasicJavaBeansSetter(IntrospectedColumn introspectedColumn)
    • addGeneratedSetterJavaDoc

      private static void addGeneratedSetterJavaDoc(Method method, IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable)
    • addGeneratedSetterAnnotation

      private static void addGeneratedSetterAnnotation(Method method, IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit)
    • isTrimStringsEnabled

      private static boolean isTrimStringsEnabled(Context context)
    • isTrimStringsEnabled

      private static boolean isTrimStringsEnabled(IntrospectedTable table)
    • isTrimStringsEnabled

      private static boolean isTrimStringsEnabled(IntrospectedColumn column)