1 package org.apache.torque.engine.database.model;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19 import java.util.List;
20
21 import org.apache.torque.engine.EngineException;
22
23 /***
24 * The generic interface to a name generation algorithm.
25 *
26 * @author <a href="mailto:dlr@finemaltcoding.com>Daniel Rall</a>
27 * @author <a href="mailto:byron_foster@byron_foster@yahoo.com>Byron Foster</a>
28 * @version $Id: NameGenerator.java,v 1.1.2.2 2004/05/20 04:34:15 seade Exp $
29 */
30 public interface NameGenerator
31 {
32 /***
33 * The character used by most implementations as the separator
34 * between name elements.
35 */
36 char STD_SEPARATOR_CHAR = '_';
37
38 /***
39 * Traditional method for converting schema table and column names
40 * to java names. The <code>CONV_METHOD_XXX</code> constants
41 * define how names for columns and tables in the database schema
42 * will be converted to java source names.
43 *
44 * @see JavaNameGenerator#underscoreMethod(String)
45 */
46 String CONV_METHOD_UNDERSCORE = "underscore";
47
48 /***
49 * Similar to {@link #CONV_METHOD_UNDERSCORE} except nothing is
50 * converted to lowercase.
51 *
52 * @see JavaNameGenerator#javanameMethod(String)
53 */
54 String CONV_METHOD_JAVANAME = "javaname";
55
56 /***
57 * Specifies no modification when converting from a schema column
58 * or table name to a java name.
59 */
60 String CONV_METHOD_NOCHANGE = "nochange";
61
62 /***
63 * Given a list of <code>String</code> objects, implements an
64 * algorithm which produces a name.
65 *
66 * @param inputs Inputs used to generate a name.
67 * @return The generated name.
68 * @throws EngineException if the name could not be generated
69 */
70 String generateName(List inputs) throws EngineException;
71 }