com.googlecode.jpattern.orm.util
Class FieldDefaultNaming

java.lang.Object
  extended by com.googlecode.jpattern.orm.util.FieldDefaultNaming

public abstract class FieldDefaultNaming
extends Object

Author:
Francesco Cina 21/mag/2011

Constructor Summary
FieldDefaultNaming()
           
 
Method Summary
static String getDBnameToJavanameDefaultMapping(String dbName, boolean startWithUpperCase)
          Return the default java filed name name associated to the DB object name Es: dbName = GET_EMPLOYEE_AGE -> return employeeAge dbName = IS_MALE -> return isMale dbName = EMPLOYEE -> return employee
static String getDefaultBooleanGetterName(String javaPropertyName)
          Return the default name of a getter for a property of type boolean.
static String getDefaultGetterName(String javaPropertyName)
          Return the default name of a getter for a property.
static String getDefaultMappingNameForMethod(String javaName)
          Remove the "is", "get" and "set" prefix from a method name and return the default column name associated to the method.
static String getDefaultSetterName(String javaPropertyName)
          Return the default name of a getter for a property.
static String getJavanameToDBnameDefaultMapping(String javaName)
          Return the default database object name associated to the javaName Es: methodName = getEmployeeAge -> return GET_EMPLOYEE_AGE methodName = isMale -> return IS_MALE methodNAme = employee -> return EMPLOYEE
static String removePrefix(String prefix, String methodName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldDefaultNaming

public FieldDefaultNaming()
Method Detail

getDefaultMappingNameForMethod

public static String getDefaultMappingNameForMethod(String javaName)
Remove the "is", "get" and "set" prefix from a method name and return the default column name associated to the method. Es: methodName = getEmployeeAge -> return EMPLOYEE_AGE methodName = isMale -> return MALE methodNAme = employee -> return ""

Parameters:
methodName -
Returns:

getJavanameToDBnameDefaultMapping

public static String getJavanameToDBnameDefaultMapping(String javaName)
Return the default database object name associated to the javaName Es: methodName = getEmployeeAge -> return GET_EMPLOYEE_AGE methodName = isMale -> return IS_MALE methodNAme = employee -> return EMPLOYEE

Parameters:
methodName -
Returns:

getDBnameToJavanameDefaultMapping

public static String getDBnameToJavanameDefaultMapping(String dbName,
                                                       boolean startWithUpperCase)
Return the default java filed name name associated to the DB object name Es: dbName = GET_EMPLOYEE_AGE -> return employeeAge dbName = IS_MALE -> return isMale dbName = EMPLOYEE -> return employee

Parameters:
dbName -
Returns:

removePrefix

public static String removePrefix(String prefix,
                                  String methodName)

getDefaultGetterName

public static String getDefaultGetterName(String javaPropertyName)
Return the default name of a getter for a property. Es: javaPropertyName = hello -> return getHello

Parameters:
javaPropertyName -
Returns:

getDefaultSetterName

public static String getDefaultSetterName(String javaPropertyName)
Return the default name of a getter for a property. Es: javaPropertyName = hello -> return setHello

Parameters:
javaPropertyName -
Returns:

getDefaultBooleanGetterName

public static String getDefaultBooleanGetterName(String javaPropertyName)
Return the default name of a getter for a property of type boolean. Es: javaPropertyName = hello -> return isHello

Parameters:
javaPropertyName -
Returns:


Copyright © 2011. All Rights Reserved.