Class JavaBeansUtil
java.lang.Object
org.mybatis.generator.internal.util.JavaBeansUtil
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getCamelCaseString
(String inputString, boolean firstCharacterUppercase) static String
getFirstCharacterUppercase
(String inputString) static String
getGetterMethodName
(String property, FullyQualifiedJavaType fullyQualifiedJavaType) Computes a getter method name.static Field
getJavaBeansField
(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable) static Field
getJavaBeansFieldWithGeneratedAnnotation
(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit) static Method
getJavaBeansGetter
(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable) static Method
getJavaBeansGetterWithGeneratedAnnotation
(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit) static Method
getJavaBeansSetter
(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable) static Method
getJavaBeansSetterWithGeneratedAnnotation
(IntrospectedColumn introspectedColumn, Context context, IntrospectedTable introspectedTable, CompilationUnit compilationUnit) static String
getSetterMethodName
(String property) Computes a setter method name.static String
getValidPropertyName
(String inputString) This method ensures that the specified input string is a valid Java property name.
-
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 propertyfullyQualifiedJavaType
- the fully qualified java type- Returns:
- the getter method name
-
getSetterMethodName
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
-
getCamelCaseString
-
getValidPropertyName
This method ensures that the specified input string is a valid Java property name.The rules are as follows:
- If the first character is lower case, then OK
- If the first two characters are upper case, then OK
- 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)
-