KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > idl > TypeCodeTypeSpec


1 /*
2  * JacORB - a free Java ORB
3  *
4  * Copyright (C) 1997-2004 Gerald Brose.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library 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 GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public
17  * License along with this library; if not, write to the Free
18  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19  */

20
21 package org.jacorb.idl;
22
23 /**
24  * @author Gerald Brose
25  * @version $Id: TypeCodeTypeSpec.java,v 1.12 2004/05/06 12:39:59 nicolas Exp $
26  */

27
28 import java.io.PrintWriter JavaDoc;
29
30 public class TypeCodeTypeSpec
31         extends TypeSpec
32 {
33
34     public TypeCodeTypeSpec( int num )
35     {
36         super( num );
37     }
38
39     public Object JavaDoc clone()
40     {
41         return this;
42     }
43
44     public String JavaDoc typeName()
45     {
46         return "org.omg.CORBA.TypeCode";
47     }
48
49     public TypeSpec typeSpec()
50     {
51         return this;
52     }
53
54     public void setPackage( String JavaDoc s )
55     {
56         s = parser.pack_replace( s );
57     }
58
59     public boolean basic()
60     {
61         return true;
62     }
63
64     public void set_constr( TypeDeclaration td )
65     {
66     }
67
68     public void parse()
69     {
70     }
71
72     public String JavaDoc toString()
73     {
74         return typeName();
75     }
76
77     /**
78      * @return a string for an expression of type TypeCode that describes this type
79      */

80     public String JavaDoc getTypeCodeExpression()
81     {
82         return "org.omg.CORBA.ORB.init().get_primitive_tc( org.omg.CORBA.TCKind.tk_TypeCode)";
83     }
84
85     public void print( PrintWriter JavaDoc ps )
86     {
87     }
88
89     public String JavaDoc holderName()
90     {
91         return typeName() + "Holder";
92     }
93
94     public String JavaDoc printReadExpression( String JavaDoc streamname )
95     {
96         return streamname + ".read_TypeCode()";
97     }
98
99     public String JavaDoc printWriteStatement( String JavaDoc var_name, String JavaDoc streamname )
100     {
101         return streamname + ".write_TypeCode(" + var_name + ");";
102     }
103
104 }
105
Popular Tags