KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > modfact > corba > xmiio > exporter > XMIExportApplication


1 /**
2  * copyright 2002 2003 Laboratoire d'Informatique Paris 6 (LIP6)
3  *
4  * This file is part of ModFact.
5  *
6  * ModFact is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * at your option) any later version.
10  *
11  * ModFact 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
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with ModFact; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */

20 package org.objectweb.modfact.corba.xmiio.exporter;
21
22 /**
23  * An abstract implementation of an XMI Export application.
24  * This class provides methods for all XMI exporters.
25  */

26 public abstract class XMIExportApplication
27     extends org.objectweb.modfact.corba.service.cmdline.common.ModfactApplicationBase
28     implements org.objectweb.modfact.corba.service.cmdline.xmiio.XMIExportApplication {
29
30     /** The PrintIOR flag. */
31     protected boolean printIOR_ = false;
32
33     /** The IOR file. */
34     protected String JavaDoc iorFile_ = "out.ior";
35
36     /** The output file. */
37     protected String JavaDoc outputFile_ = new String JavaDoc();
38
39     /** The output directory. */
40     protected String JavaDoc outputDir_ = new String JavaDoc();
41
42     /** The name in the name service. */
43     protected String JavaDoc nameService_ = new String JavaDoc();
44
45     /** The DTD uri. */
46     protected String JavaDoc dtdFile_ = new String JavaDoc();
47
48     /**
49      * XMIImportApplication constructor.
50      * @param package_name The package name.
51      * @param class_name The class name.
52      * @param default_ior_file The default IOR file.
53      */

54     protected XMIExportApplication(String JavaDoc package_name, String JavaDoc class_name) {
55         this(
56             new org.objectweb.util.cmdline.lib.DefaultCommandLine(
57                 new String JavaDoc[] { class_name },
58                 new String JavaDoc[0],
59                 new String JavaDoc[] { "Export a model (" + package_name + ") to an XMI file." },
60                 true));
61     }
62
63     /**
64      * XMIImportApplication constructor.
65      * @param commandLine The command line manager.
66      */

67     private XMIExportApplication(org.objectweb.util.cmdline.lib.DefaultCommandLine commandLine) {
68         super(commandLine);
69         // Creates the XMIExportApplication options
70
commandLine.addOption(new org.objectweb.modfact.corba.service.cmdline.io.OptionOutput(this));
71         commandLine.addOption(new org.objectweb.modfact.corba.service.cmdline.xmiio.OptionDTDFile(this));
72         commandLine.addOption(new org.objectweb.modfact.corba.service.cmdline.xmiio.OptionIORFile(this));
73         commandLine.addOption(new org.objectweb.modfact.corba.service.cmdline.xmiio.OptionPrintIOR(this));
74     }
75
76     /**
77      * Set the IOR file.
78      * @param filename The IOR filename.
79      */

80     public void setIORFile(String JavaDoc filename) {
81         iorFile_ = filename;
82     }
83
84     /**
85      * Set the output file.
86      * @param filename The output filename.
87      */

88     public void setOutput(String JavaDoc filename) {
89         outputFile_ = filename;
90     }
91
92     /**
93      * Set the output directory.
94      * @param directory The output directory.
95      */

96     public void setOutputDir(String JavaDoc directory) {
97         outputDir_ = directory;
98     }
99
100     /**
101      * Set the PrintIOR flag.
102      * @param print TRUE to display the IOR on the console.
103      */

104     public void setPrintIOR(boolean print) {
105         printIOR_ = print;
106     }
107
108     /**
109      * Set the name in the Name Service.
110      * @param nameService The name in the Name Service.
111      */

112     public void setNameService(String JavaDoc nameService) {
113         nameService_ = nameService;
114     }
115
116     /**
117      * Set the DTD file.
118      * @param filename The DTD filename.
119      */

120     public void setDTDFile(String JavaDoc filename) {
121         dtdFile_ = filename;
122     }
123
124 }
125
Popular Tags