001: /**
002: * Speedo: an implementation of JDO compliant personality on top of JORM generic
003: * I/O sub-system.
004: * Copyright (C) 2001-2004 France Telecom R&D
005: *
006: * This library is free software; you can redistribute it and/or
007: * modify it under the terms of the GNU Lesser General Public
008: * License as published by the Free Software Foundation; either
009: * version 2 of the License, or (at your option) any later version.
010: *
011: * This library is distributed in the hope that it will be useful,
012: * but WITHOUT ANY WARRANTY; without even the implied warranty of
013: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014: * Lesser General Public License for more details.
015: *
016: * You should have received a copy of the GNU Lesser General Public
017: * License along with this library; if not, write to the Free Software
018: * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
019: *
020: *
021: *
022: * Contact: speedo@objectweb.org
023: *
024: * Authors: S.Chassande-Barrioz.
025: *
026: */package org.objectweb.speedo.generation.api;
027:
028: import org.apache.tools.ant.taskdefs.Javac;
029: import org.apache.tools.ant.types.Path;
030: import org.objectweb.speedo.lib.Personality;
031: import org.objectweb.speedo.metadata.SpeedoMetaInfo;
032: import org.objectweb.speedo.naming.lib.NamingManagerFactory;
033: import org.objectweb.util.monolog.api.LoggerFactory;
034:
035: import java.util.ArrayList;
036: import java.util.Collection;
037: import java.util.HashMap;
038: import java.util.Map;
039:
040: /**
041: * This class groups all parameter of the Speedo generator/compiler/enhancer.
042: *
043: * @author S.Chassande-Barrioz
044: */
045: public class SpeedoCompilerParameter {
046:
047: /**
048: * The logging configuration file
049: */
050: public String logPropFile = null;
051:
052: /**
053: * The logger factory instance
054: */
055: public LoggerFactory loggerFactory = null;
056:
057: /**
058: * The jorm project name. The default value is an empty string (not nul)
059: */
060: public String projectName = "";
061:
062: /**
063: * The jorm mapper name. The default value is null. This field MUST be set
064: */
065: public String mapperName = null;
066:
067: /**
068: * indicates if the generated java file must be kept or not
069: */
070: public boolean keepsrc = true;
071:
072: /**
073: * the location of the user .class files
074: * the location where the generated files will be produced
075: */
076: public String output;
077:
078: /**
079: * The default source directory
080: */
081: public String input;
082:
083: public Collection jormclasspath = null;
084: public Path speedoclasspath = null;
085:
086: /**
087: * indicates if the .pd files must be generated
088: */
089: public boolean generateNeededJormFile = false;
090:
091: /**
092: * The output directory of the .pd files
093: */
094: public String pdoutput;
095:
096: /**
097: * The Speedo meta information
098: */
099: public SpeedoMetaInfo smi = new SpeedoMetaInfo();
100:
101: /**
102: * the classpath to compile. must include Jorm, Speedo, user classes.
103: */
104: public Path classpath = null;
105:
106: /**
107: * The list of .jdo file locations. The location is relative to the value
108: * of the 'jdoDir' variable.
109: */
110: public Collection xml = null;
111:
112: /**
113: * The base directory of the location of xml file (persistent descriptor)
114: */
115: public String xmlDir = null;
116:
117: /**
118: * The list of .pd file locations. The location is relative to the value
119: * of the 'jormDir' variable.
120: */
121: public Collection jorm = null;
122:
123: /**
124: * The base directory of the location of .pd file
125: */
126: public String jormDir = null;
127:
128: /**
129: * The list of .class file locations of the aware class. The location is
130: * relative to the value of the 'jormDir' variable.
131: */
132: public Collection awareFiles = null;
133:
134: /**
135: * The base directory of the location of .class of aware class
136: */
137: public String awareFilesDir = null;
138:
139: /**
140: * list of DTDLocation instance
141: */
142: public ArrayList dtdLocations = new ArrayList();
143:
144: /**
145: * The compiler to use
146: */
147: public Javac javac = null;
148:
149: /**
150: * The NamingManagerFactory instance to use. It permits to build the jorm
151: * meta information.
152: */
153: public NamingManagerFactory nmf = new NamingManagerFactory();
154:
155: /**
156: * Defines a map holding stuffs between component generators.
157: */
158: public final Map generatorsContext = new HashMap();
159:
160: public Personality personality;
161:
162: public Map getXmldescriptor() {
163: return smi.xmlDescriptors;
164: }
165:
166: public void setXmldescriptor(Map xmldescriptor) {
167: smi.xmlDescriptors = xmldescriptor;
168: }
169:
170: /**
171: * Clean this parameter holder.
172: */
173: public void clean() {
174: awareFiles = null;
175: awareFilesDir = null;
176: classpath = null;
177: dtdLocations = null;
178: input = null;
179: javac = null;
180: xml = null;
181: xmlDir = null;
182: jormclasspath = null;
183: jormDir = null;
184: nmf = null;
185: smi = null;
186: speedoclasspath = null;
187: }
188: }
|