01: /*
02: * JacORB - a free Java ORB
03: *
04: * Copyright (C) 1997-2004 Gerald Brose.
05: *
06: * This library is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU Library General Public
08: * License as published by the Free Software Foundation; either
09: * 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: ValueBase.java,v 1.3 2006/06/19 10:34:57 alphonse.bendt Exp $
26: */
27:
28: public class ValueBase extends BaseType {
29: public ValueBase(int num) {
30: super (num);
31: }
32:
33: public Object clone() {
34: return this ;
35: }
36:
37: public String typeName() {
38: return "java.io.Serializable";
39: }
40:
41: public TypeSpec typeSpec() {
42: return this ;
43: }
44:
45: public void setPackage(String s) {
46: s = parser.pack_replace(s);
47: }
48:
49: public boolean basic() {
50: return true;
51: }
52:
53: public void set_constr(TypeDeclaration td) {
54: }
55:
56: public void parse() {
57: }
58:
59: public String toString() {
60: return typeName();
61: }
62:
63: /**
64: * @return a string for an expression of type TypeCode that describes this type
65: */
66: public String getTypeCodeExpression() {
67: return "org.omg.CORBA.ORB.init().create_value_tc(\""
68: + id()
69: + "\",\"ValueBase\", org.omg.CORBA.VM_NONE.value, org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.tk_null), new org.omg.CORBA.ValueMember[]{} )";
70: }
71:
72: public String id() {
73: return "IDL:omg.org/CORBA/ValueBase:1.0";
74: }
75:
76: public void print(java.io.PrintWriter ps) {
77: }
78:
79: public String holderName() {
80: return typeName() + "Holder";
81: }
82:
83: public String printReadExpression(String streamname) {
84: return "((org.omg.CORBA_2_3.portable.InputStream)" + streamname
85: + ").read_value()";
86: }
87:
88: public String printWriteStatement(String var_name, String streamname) {
89: return "((org.omg.CORBA_2_3.portable.OutputStream)"
90: + streamname + ").write_value(" + var_name + ");";
91: }
92: }
|