KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > generator > translator > idl2java > api > CommonTranslator


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): Mathieu Vadet, Christophe Demarey.
23 Contributor(s): ______________________________________.
24
25 ====================================================================*/

26
27 package org.objectweb.openccm.generator.translator.idl2java.api;
28
29 // Package dependencies.
30
import org.objectweb.openccm.ast.api.Declaration;
31
32 /**
33  * This interface offers some IDL translations such as IDL names to Java names, etc.
34  *
35  * @author <a HREF="mailto:Mathieu.Vadet@lifl.fr">Mathieu Vadet</a>
36  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
37  *
38  * @version 0.1
39  */

40
41 public interface CommonTranslator
42 {
43     // ==================================================================
44
//
45
// Public methods.
46
//
47
// ==================================================================
48

49     /**
50      * Translate a TypeRef into its java mapping.
51      *
52      * @param typeref - The TypeRef to translate.
53      *
54      * @return The resulting mapping.
55      **/

56     public java.lang.String JavaDoc
57     toJava(org.objectweb.openccm.ast.api.TypeRef typeref);
58
59     /**
60      * Translate a parameter into its java mapping.
61      *
62      * @param typeref - The TypeRef to translate.
63      * @param mode - The parameter mode (in, out or inout).
64      *
65      * @return The resulting mapping.
66      **/

67     public java.lang.String JavaDoc
68     toJava(org.objectweb.openccm.ast.api.TypeRef type,
69            int mode);
70
71     /**
72      * Check if id is a java keyword.
73      *
74      * @param id - The string to check
75      *
76      * @return A valid string.
77      **/

78     public java.lang.String JavaDoc
79     checkKeywords(java.lang.String JavaDoc id);
80
81     /**
82      * Get the java absolute name of a declaration
83      * ( i.e. package.decl_name ).
84      *
85      * @param decl - The declaration to translate
86      *
87      * @return The java absolute name.
88      **/

89     public java.lang.String JavaDoc
90     getAbsoluteName(Declaration decl);
91
92     /**
93      * Get the package of a declaration.
94      *
95      * @param decl - The declaration to translate
96      *
97      * @return The java package name.
98      **/

99     public java.lang.String JavaDoc
100     getPackage(Declaration decl);
101
102     /**
103      * Get the java path of a declaration.
104      * This don't include the declaration's java name.
105      * The package name is translated to a path.
106      *
107      * @param decl - The declaration to translate
108      *
109      * @return The java package name.
110      **/

111     public String JavaDoc
112     getAsDirectory(String JavaDoc package_name);
113
114     /**
115      * Get the java path of a declaration.
116      * This don't include the declaration's java name.
117      * The package name is translated to a path.
118      *
119      * @param decl - The declaration to translate
120      *
121      * @return The java package name.
122      **/

123     public java.lang.String JavaDoc
124     getAsDirectory(Declaration decl);
125
126     /**
127      * Get the null value for an IDL3 TypeRef
128      *
129      * @param typeref - The TypeRef to translate.
130      *
131      * @return The null value for this typeref.
132      **/

133     public java.lang.String JavaDoc
134     nullValue(org.objectweb.openccm.ast.api.TypeRef typeref);
135 }
Popular Tags