KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > jorm > compiler > api > JormCompilerParameter


1 /**
2  * JORM: an implementation of a generic mapping system for persistent Java
3  * objects. Two mapping are supported: to RDBMS and to binary files.
4  * Copyright (C) 2001-2003 France Telecom R&D - INRIA
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  *
20  * Contact: jorm-team@objectweb.org
21  *
22  */

23
24 package org.objectweb.jorm.compiler.api;
25
26 import org.objectweb.jorm.api.PException;
27 import org.objectweb.jorm.util.io.api.PathExplorer;
28 import org.objectweb.jorm.util.api.Loggable;
29
30 import java.io.InputStream JavaDoc;
31 import java.util.ArrayList JavaDoc;
32 import java.util.Collection JavaDoc;
33 import java.util.Iterator JavaDoc;
34
35 /**
36  * A JormCompilerParameter object is an object which manages informations
37  * read by the command line parser. These informations are needed to
38  * the compiler system to parse, generate, and compile.
39  * @author X. Spengler
40  */

41 public interface JormCompilerParameter extends Cloneable JavaDoc, Loggable {
42     /**
43      * The pattern that represents the JORM class name to be replaced into
44      * the string defining the inherited class of a either the PBinding or the
45      * PClassMapping that is generated.
46      */

47     String JavaDoc INHERITANCE_CLASSNAME_PATTERN = "%c";
48     String JavaDoc INHERITANCE_PACKAGE_PATTERN = "%p";
49
50     /**
51      * Prints informations managed by the current object.
52      */

53     void print();
54
55     /**
56      * Computes the actual class name which the generated PClassMapping class
57      * must extend.
58      * @param cn The class name of the persistent class for which the
59      * code is generated.
60      * @return The computed class name.
61      */

62     String JavaDoc computePClassMappingInheritance(String JavaDoc cn);
63
64     /**
65      * Computes the actual class name which the generated PBinding class
66      * must extend.
67      * @param cn The class name of the persistent class for which the
68      * code is generated.
69      * @return The computed class name.
70      */

71     String JavaDoc computePBindingInheritance(String JavaDoc cn);
72
73     /**
74      * Load a jorm configuration file.
75      * @param file the name of the jorm configuration file
76      */

77     void loadConfFile(String JavaDoc file, Iterator JavaDoc knownmappers) throws PException;
78
79     /**
80      * Load a jorm configuration file.
81      * @param in the input stream of the jorm configuration file
82      */

83     void loadConfFile(InputStream JavaDoc in, Iterator JavaDoc knownmappers) throws PException;
84
85     PathExplorer getClasspath();
86
87     /**
88      * @return the output directory where the generated will be put
89      */

90     String JavaDoc getOutput();
91
92     /**
93      * @return a boolean value indicating if the verbose mode is activated
94      */

95     boolean isVerbose();
96
97     Collection JavaDoc getInputFiles();
98
99     boolean isKeepSrc();
100
101     String JavaDoc getJavacName();
102
103     String JavaDoc getProjectName();
104
105     boolean isJavac();
106
107     boolean isParseOnly();
108
109     /**
110      * @return the name of the class inherited by the generated XXXBinding
111      */

112     String JavaDoc getBindingInheritance();
113
114     String JavaDoc getClassMappingInheritance();
115
116     boolean isBindingAbstract();
117
118     ArrayList JavaDoc getDtdLocations();
119
120     boolean isGeneratedPDFiles();
121
122     boolean isGeneratedWithMapperPackage();
123
124     void setClasspath(PathExplorer classpath);
125
126     void setOutput(String JavaDoc output);
127
128     void setVerbose(boolean verbose);
129
130     void setKeepSrc(boolean keepSrc);
131
132     void setProjectName(String JavaDoc projectName);
133
134     void setJavac(boolean javac);
135
136     void setBindingInheritance(String JavaDoc bindingInheritance);
137
138     void setClassMappingInheritance(String JavaDoc classMappingInheritance);
139
140     void setBindingAbstract(boolean bindingAbstract);
141
142     void setDtdLocations(ArrayList JavaDoc dtdLocations);
143
144     void setGeneratedPDFiles(boolean generatedPDFiles);
145
146     void setInputFiles(Collection JavaDoc inputFiles);
147
148     void setGeneratedWithMapperPackage(boolean generatedWithMapperPackage);
149
150     void setLogConfFile(String JavaDoc logConfFile);
151
152     Object JavaDoc clone();
153 }
154
Popular Tags