KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > ccm > visitorIDL3 > xmi > IDL3_XMI


1 /*====================================================================
2
3 OpenCCM: The Open CORBA Component Model Platform
4 Copyright (C) 2000-2002 USTL - LIFL - GOAL
5 Contact: openccm-team@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): Mathieu Vadet
23                       Tran Huynh (tran.huynh@fr.thalesgroup.com)
24 Contributor(s): .
25
26 ====================================================================*/

27
28 package org.objectweb.ccm.visitorIDL3.xmi;
29
30 /**
31  * This class generates XMI from IDL3.
32  */

33 public class IDL3_XMI
34     extends org.objectweb.ccm.visitorIDL3.common.Generator {
35
36     /**
37      * Name of the file to generate.
38      */

39     private java.lang.String JavaDoc filename_;
40
41     /**
42      * Location of the XMI DTD.
43      */

44     private java.lang.String JavaDoc xmidtd_;
45
46     /**
47      * Constructor.
48      *
49      * @param repository The Interface Repository.
50      *
51      * @exception fr.lifl.cim.jidlscript.lang.JISError
52      */

53     public
54     IDL3_XMI(org.objectweb.ccm.IDL3.Repository repository)
55         throws fr.lifl.cim.jidlscript.lang.JISError {
56
57         super(repository);
58
59         // Create a printer.
60
XMIPrinter printer = new XMIPrinter(this, " ");
61
62         // Use this printer.
63
setPrinter(printer);
64     }
65
66     /**
67      * Setters.
68      */

69
70     /**
71      * This method sets the XMI DTD.
72      *
73      * @param xmidtd The XMI DTD.
74      */

75     public void
76     setDTD(java.lang.String JavaDoc xmidtd) {
77         xmidtd_ = xmidtd;
78     }
79
80     /**
81      * This method sets the name of the file to generate.
82      *
83      * @param filename The filename.
84      */

85     public void
86     setFilename(java.lang.String JavaDoc filename) {
87         filename_ = filename;
88     }
89
90     /**
91      * Getters.
92      */

93
94     /**
95      * This method returns the XMI DTD.
96      *
97      * @return The location of the XMI DTD.
98      */

99     public java.lang.String JavaDoc
100     getDTD() {
101         return xmidtd_;
102     }
103
104     /**
105      * This method returns the name of the file to generate.
106      *
107      * @return The file name.
108      */

109     public java.lang.String JavaDoc
110     getFilename() {
111         return filename_;
112     }
113
114     /**
115      * This method visits the Interface Repository
116      * and generates the file.
117      *
118      * @param name The IR Object to visit.
119      * @param filename The name of the file to generate.
120      * @param xmidtd The XMI DTD.
121      */

122     public void
123     generate(java.lang.String JavaDoc name,
124              java.lang.String JavaDoc filename,
125              java.lang.String JavaDoc xmidtd) {
126         setDTD(xmidtd);
127         setFilename(filename);
128         super.visitObj(name);
129     }
130 }
131
Popular Tags