01: /*
02: * Copyright 2006 Le Duc Bao, Ralf Joachim
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License"); you may not
05: * use this file except in compliance with the License. You may obtain a copy of
06: * the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
10: * Unless required by applicable law or agreed to in writing, software
11: * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12: * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13: * License for the specific language governing permissions and limitations under
14: * the License.
15: */
16: package org.castor.ddlgen;
17:
18: import java.io.OutputStream;
19:
20: import org.exolab.castor.mapping.Mapping;
21:
22: /**
23: * Generator is the interface for various generators.
24: *
25: * @author <a href="mailto:leducbao AT gmail DOT com">Le Duc Bao</a>
26: * @author <a href="mailto:ralf DOT joachim AT syscon DOT eu">Ralf Joachim</a>
27: * @version $Revision: 5951 $ $Date: 2006-04-25 16:09:10 -0600 (Tue, 25 Apr 2006) $
28: * @since 1.1
29: */
30: public interface Generator {
31: //--------------------------------------------------------------------------
32:
33: /** Global configuration file path. */
34: String GLOBAL_CONFIG_PATH = "org/castor/ddlgen/";
35:
36: /** Global configuration file name. */
37: String GLOBAL_CONFIG_NAME = "ddlgen.properties";
38:
39: //--------------------------------------------------------------------------
40:
41: /**
42: * Initialize generator.
43: */
44: void initialize();
45:
46: //--------------------------------------------------------------------------
47:
48: /**
49: * Get engine name.
50: *
51: * @return Engine name
52: */
53: String getEngineName();
54:
55: /**
56: * Get engine configuration file path.
57: *
58: * @return Engine configuration file path
59: */
60: String getEngineConfigPath();
61:
62: /**
63: * Get engine configuration file name.
64: *
65: * @return Engine configuration file name
66: */
67: String getEngineConfigName();
68:
69: //--------------------------------------------------------------------------
70:
71: /**
72: * Set mapping document.
73: *
74: * @param mappingDoc Mapping document.
75: */
76: void setMapping(Mapping mappingDoc);
77:
78: /**
79: * Set key generator registry.
80: *
81: * @param keygenRegistry Key generator registry.
82: */
83: void setKeyGenRegistry(KeyGeneratorRegistry keygenRegistry);
84:
85: //--------------------------------------------------------------------------
86:
87: /**
88: * Generate DDL for a mapping document.
89: *
90: * @param output Output stream for output.
91: * @throws GeneratorException If failed to generate DDL.
92: */
93: void generateDDL(OutputStream output) throws GeneratorException;
94:
95: //--------------------------------------------------------------------------
96: }
|