KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > openccm > generator > translator > ast2idl > lib > AST_CIDLTranslator


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.generator.translator.ast2idl.lib;
28
29 // To acces AST CategoryKind
30
import org.objectweb.openccm.ast.api.CategoryKind;
31
32 /**
33  * Utility class to translate CIDL types in string format.
34  *
35  * @author <a HREF="mailto:Christophe.Demarey@lifl.fr">Christophe Demarey</a>
36  *
37  * @version 0.1
38  */

39
40 public class AST_CIDLTranslator
41      extends org.objectweb.openccm.generator.translator.ast2idl.lib.AST_PSDLTranslator
42   implements org.objectweb.openccm.generator.translator.ast2idl.api.AST_CIDLTranslator
43 {
44     // ==================================================================
45
//
46
// Internal state.
47
//
48
// ==================================================================
49

50     // ==================================================================
51
//
52
// Constructor.
53
//
54
// ==================================================================
55

56     /**
57      * The default constructor.
58      **/

59     public
60     AST_CIDLTranslator()
61     {
62         super();
63         keywords_.add("bindsTo");
64         keywords_.add("composition");
65         keywords_.add("delegatesTo");
66         keywords_.add("entity");
67         keywords_.add("executor");
68         keywords_.add("facet");
69         // Already defined in PSDL
70
// keywords_.add("implements");
71
keywords_.add("process");
72         keywords_.add("proxy");
73         keywords_.add("segment");
74         keywords_.add("service");
75         keywords_.add("session");
76         // Already defined in PSDL
77
// keywords_.add("storagehome");
78
keywords_.add("storedOn");
79     }
80
81     // ==================================================================
82
//
83
// Internal methods.
84
//
85
// ==================================================================
86

87     // ==================================================================
88
//
89
// Public methods.
90
//
91
// ==================================================================
92

93     /**
94      * Translate a cidl category kind into its string format.
95      *
96      * @param ck - The category kind to translate.
97      *
98      * @return The resulting string.
99      **/

100     public String JavaDoc
101     toCIDL(CategoryKind ck)
102     {
103         if (ck == CategoryKind.ck_entity)
104             return "entity";
105         else if (ck == CategoryKind.ck_process)
106             return "process";
107         else if (ck == CategoryKind.ck_service)
108             return "service";
109         else
110             return "session";
111     }
112
113 }
114
Popular Tags