|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.torque.engine.database.model.JavaNameGenerator
public class JavaNameGenerator
A NameGenerator
implementation for Java-esque names.
Field Summary |
---|
Fields inherited from interface org.apache.torque.engine.database.model.NameGenerator |
---|
CONV_METHOD_JAVANAME, CONV_METHOD_NOCHANGE, CONV_METHOD_UNDERSCORE, CONV_METHOD_UNDERSCORE_OMIT_SCHEMA, SCHEMA_SEPARATOR_CHAR, STD_SEPARATOR_CHAR |
Constructor Summary | |
---|---|
JavaNameGenerator()
|
Method Summary | |
---|---|
String |
generateName(List inputs)
inputs should consist of two elements, the
original name of the database element and the method for
generating the name. |
protected String |
javanameMethod(String schemaName)
Converts a database schema name to java object name. |
protected String |
nochangeMethod(String name)
Converts a database schema name to java object name. |
protected String |
underscoreMethod(String schemaName)
Converts a database schema name to java object name. |
protected String |
underscoreOmitSchemaMethod(String schemaName)
Converts a database schema name to java object name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public JavaNameGenerator()
Method Detail |
---|
public String generateName(List inputs)
inputs
should consist of two elements, the
original name of the database element and the method for
generating the name. There are currently three methods:
CONV_METHOD_NOCHANGE
- xml names are converted
directly to java names without modification.
CONV_METHOD_UNDERSCORE
will capitalize the first
letter, remove underscores, and capitalize each letter before
an underscore. All other letters are lowercased. "javaname"
works the same as the CONV_METHOD_JAVANAME
method
but will not lowercase any characters.
generateName
in interface NameGenerator
inputs
- list expected to contain two parameters, element
0 contains name to convert, element 1 contains method for conversion.
NameGenerator
protected String underscoreMethod(String schemaName)
STD_SEPARATOR_CHAR
and SCHEMA_SEPARATOR_CHAR
,
capitilizes first letter of name and each letter after the
STD_SEPERATOR
and SCHEMA_SEPARATOR_CHAR
,
converts the rest of the letters to lowercase.
schemaName
- name to be converted.
NameGenerator
,
underscoreMethod(String)
protected String underscoreOmitSchemaMethod(String schemaName)
SCHEMA_SEPARATOR_CHAR
. Then, in a second step, removes
STD_SEPARATOR_CHAR
, capitilizes first letter of
name and each letter after the STD_SEPERATOR
,
and converts the rest of the letters to lowercase.
schemaName
- name to be converted.
NameGenerator
,
underscoreOmitSchemaMethod(String)
protected String javanameMethod(String schemaName)
schemaName
- name to be converted.
NameGenerator
,
underscoreMethod(String)
protected final String nochangeMethod(String name)
name
- name to be converted.
name
parameter, unchanged.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |