| java.lang.Object org.ofbiz.entity.model.ModelUtil
ModelUtil | public class ModelUtil (Code) | | Generic Entity - General Utilities
author: David E. Jones version: $Revision: 1.5 $ since: 2.0 |
Method Summary | |
public static String | dbNameToClassName(String columnName) Converts a database name to a Java class name.
The naming conventions used to allow for this are as follows: a database name (table or
column) is in all capital letters, and the words are separated by an underscore
(for example: NEAT_ENTITY_NAME or RANDOM_FIELD_NAME); a Java name (ejb or field) is in all
lower case letters, except the letter at the beginning of each word (for example:
NeatEntityName or RandomFieldName). | public static String | dbNameToVarName(String columnName) Converts a database name to a Java variable name.
The naming conventions used to allow for this are as follows: a database name (table or
column) is in all capital letters, and the words are separated by an underscore
(for example: NEAT_ENTITY_NAME or RANDOM_FIELD_NAME); a Java name (ejb or field) is in all
lower case letters, except the letter at the beginning of each word (for example:
NeatEntityName or RandomFieldName). | public static String | induceFieldType(String sqlTypeName, int length, int precision, ModelFieldTypeReader fieldTypeReader) | public static String | javaNameToDbName(String javaName) Converts a Java variable name to a database name.
The naming conventions used to allow for this are as follows: a database name (table or
column) is in all capital letters, and the words are separated by an underscore
(for example: NEAT_ENTITY_NAME or RANDOM_FIELD_NAME); a Java name (ejb or field) is in all
lower case letters, except the letter at the beginning of each word (for example:
NeatEntityName or RandomFieldName). | public static String | lowerFirstChar(String string) Changes the first letter of the passed String to lower case. | public static String | packageToPath(String packageName) Converts a package name to a path by replacing all '.' characters with the File.separatorChar character. | public static String | replaceString(String mainString, String oldString, String newString) | public static String | shortenDbName(String dbName, int desiredLength) | public static String | upperFirstChar(String string) Changes the first letter of the passed String to upper case. |
dbNameToClassName | public static String dbNameToClassName(String columnName)(Code) | | Converts a database name to a Java class name.
The naming conventions used to allow for this are as follows: a database name (table or
column) is in all capital letters, and the words are separated by an underscore
(for example: NEAT_ENTITY_NAME or RANDOM_FIELD_NAME); a Java name (ejb or field) is in all
lower case letters, except the letter at the beginning of each word (for example:
NeatEntityName or RandomFieldName). The convention of using a capital letter at
the beginning of a class name in Java, or a lower-case letter for the beginning of a
variable name in Java is also used along with the Java name convention above.
Parameters: columnName - The database name The Java class name |
dbNameToVarName | public static String dbNameToVarName(String columnName)(Code) | | Converts a database name to a Java variable name.
The naming conventions used to allow for this are as follows: a database name (table or
column) is in all capital letters, and the words are separated by an underscore
(for example: NEAT_ENTITY_NAME or RANDOM_FIELD_NAME); a Java name (ejb or field) is in all
lower case letters, except the letter at the beginning of each word (for example:
NeatEntityName or RandomFieldName). The convention of using a capital letter at
the beginning of a class name in Java, or a lower-case letter for the beginning of a
variable name in Java is also used along with the Java name convention above.
Parameters: columnName - The database name The Java variable name |
javaNameToDbName | public static String javaNameToDbName(String javaName)(Code) | | Converts a Java variable name to a database name.
The naming conventions used to allow for this are as follows: a database name (table or
column) is in all capital letters, and the words are separated by an underscore
(for example: NEAT_ENTITY_NAME or RANDOM_FIELD_NAME); a Java name (ejb or field) is in all
lower case letters, except the letter at the beginning of each word (for example:
NeatEntityName or RandomFieldName). The convention of using a capital letter at
the beginning of a class name in Java, or a lower-case letter for the beginning of a
variable name in Java is also used along with the Java name convention above.
Parameters: javaName - The Java variable name The database name |
lowerFirstChar | public static String lowerFirstChar(String string)(Code) | | Changes the first letter of the passed String to lower case.
Parameters: string - The passed String A String with a lower case first letter |
packageToPath | public static String packageToPath(String packageName)(Code) | | Converts a package name to a path by replacing all '.' characters with the File.separatorChar character.
Is therefore platform independent.
Parameters: packageName - The package name. The path name corresponding to the specified package name. |
replaceString | public static String replaceString(String mainString, String oldString, String newString)(Code) | | Replaces all occurances of oldString in mainString with newString
Parameters: mainString - The original string Parameters: oldString - The string to replace Parameters: newString - The string to insert in place of the old mainString with all occurances of oldString replaced by newString |
shortenDbName | public static String shortenDbName(String dbName, int desiredLength)(Code) | | Start by removing all vowels, then pull 1 letter at a time off the end of each _ separated segment, go until it is less than or equal to the desired length
Parameters: dbName - Parameters: desiredLength - shortened String |
upperFirstChar | public static String upperFirstChar(String string)(Code) | | Changes the first letter of the passed String to upper case.
Parameters: string - The passed String A String with an upper case first letter |
|
|