KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > task > PsdlToJava


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2004 INRIA & USTL - LIFL - GOAL
5 Contact: openccm@objectweb.org
6
7 This library is free software; you can redistribute it and/or
8 modify it under the terms of the GNU Lesser General Public
9 License as published by the Free Software Foundation; either
10 version 2.1 of the License, or any later version.
11
12 This library 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 GNU
15 Lesser General Public License for more details.
16
17 You should have received a copy of the GNU Lesser General Public
18 License along with this library; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
20 USA
21
22 Initial developer(s): Christophe Demarey.
23 Contributor(s): ________________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.task;
28
29 // Package dependencies
30
import java.util.Map JavaDoc;
31
32 /**
33  * This task feeds an IDL / PSDL / CIDL file in the OpenCCM Interface Repository.
34  *
35  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
36  *
37  * @version 0.1
38  */

39 public class PsdlToJava
40      extends CompilerBase
41   implements Runnable JavaDoc
42 {
43     // ==================================================================
44
//
45
// Internal states.
46
//
47
// ==================================================================
48

49     /** The output directory for Java Mapping. */
50     private String JavaDoc output_directory_;
51
52     /** The user property file. */
53     private String JavaDoc user_property_file_;
54     
55     // ==================================================================
56
//
57
// Constructors.
58
//
59
// ==================================================================
60

61     /**
62      * The default constructor.
63      *
64      * @param project_properties - Properties of the Ant Project.
65      */

66     public PsdlToJava(Map JavaDoc project_properties)
67     {
68         // Call CompilerBase constructor
69
super(project_properties);
70         
71         // Init internal state
72
output_directory_ = "generated";
73         user_property_file_ = null;
74     }
75     
76     // ==================================================================
77
//
78
// Internal methods.
79
//
80
// ==================================================================
81

82     // ==================================================================
83
//
84
// Public methods.
85
//
86
// ==================================================================
87

88     /**
89      * Configure the task.
90      */

91     public void
92     configure()
93     {
94         // Call the CompilerBase configure method
95
super.configure();
96         
97         setXmlFile( project_properties_.getProperty("OpenCCM_HOMEDIR") + "/xml/launcher/PSDLtoJava.xml" );
98         if (user_property_file_ != null)
99         {
100             addArgument("-userprop");
101             addArgument(user_property_file_);
102         }
103         addArgument("-d");
104         addArgument(output_directory_);
105     }
106
107     /**
108      * Set Java mapping output directory.
109      *
110      * @param outputdir - The output directory name.
111      */

112     public void
113     setDestdir(String JavaDoc destdir)
114     {
115         output_directory_ = destdir;
116     }
117     
118     /**
119      * Set user properties file.
120      *
121      * @param file - The user property file name.
122      */

123     public void
124     setPropertiesfile(String JavaDoc file)
125     {
126         user_property_file_ = file;
127     }
128 }
129
Popular Tags