01: ///////////////////////////////////////////////////////////////////////////////
02: //
03: // Copyright (C) 2003-@year@ by Thomas M. Hazel, MyOODB (www.myoodb.org)
04: //
05: // All Rights Reserved
06: //
07: // This program is free software; you can redistribute it and/or modify
08: // it under the terms of the GNU General Public License and GNU Library
09: // General Public License as published by the Free Software Foundation;
10: // either version 2, or (at your option) any later version.
11: //
12: // This program is distributed in the hope that it will be useful,
13: // but WITHOUT ANY WARRANTY; without even the implied warranty of
14: // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15: // GNU General Public License and GNU Library General Public License
16: // for more details.
17: //
18: // You should have received a copy of the GNU General Public License
19: // and GNU Library General Public License along with this program; if
20: // not, write to the Free Software Foundation, 675 Mass Ave, Cambridge,
21: // MA 02139, USA.
22: //
23: ///////////////////////////////////////////////////////////////////////////////
24: package org.myoodb.tools.generator;
25:
26: public abstract interface AbstractCodeGenerator {
27: public class Parameter {
28: private String m_type;
29: private String m_name;
30: private String m_fullName;
31:
32: public Parameter(String type, String name, String fullName) {
33: m_type = type;
34: m_name = name;
35: m_fullName = fullName;
36: }
37:
38: public String getType() {
39: return m_type;
40: }
41:
42: public String getName() {
43: return m_name;
44: }
45:
46: public Class getClassType() throws ClassNotFoundException {
47: Class classType = Helper.classForPrimitive(m_fullName);
48: if (classType == null) {
49: classType = Class.forName(m_fullName);
50: }
51:
52: return classType;
53: }
54:
55: public String toString() {
56: return m_type + " " + m_name;
57: }
58: }
59:
60: public void beginClass(String sourcePath, String className)
61: throws GeneratorException;
62:
63: public void makeMethod(String methodName, int accessLevel)
64: throws GeneratorException;
65:
66: public void endClass() throws GeneratorException;
67: }
|