Class JavaBeansUtil

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

public class JavaBeansUtil extends Object
  • 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)
    • getJavaBeansField

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

      public static Field getJavaBeansFieldWithGeneratedAnnotation(IntrospectedColumn introspectedColumn, Context context, 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)