1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class ValueBoxDef_impl 42 extends Contained_impl 43 implements ValueBoxDefOperations 44 { 45 51 52 protected IDLType_ref original_type_def_; 53 54 60 61 public 62 ValueBoxDef_impl(IFR ifr, 63 Container_impl container) 64 { 65 super(ifr, container); 67 68 setServant(new ValueBoxDefPOATie(this)); 70 71 original_type_def_ = new IDLType_ref(this); 73 } 74 75 81 85 protected TypeCode 86 recursiveType(java.util.List idSeq) 87 { 88 try 89 { 90 Contained_impl cont = (Contained_impl)original_type_def_.getBaseImpl(); 91 int idx = idSeq.indexOf(cont.id()); 92 if (idx!=-1) 93 { 94 throw exceptionIllegalRecursion(id(), cont.id()); 95 } 96 } 97 catch (java.lang.ClassCastException ex) 98 { 99 } 100 101 TypeCode tc = original_type_def_.recursiveType(idSeq); 102 103 return getIFR().getTCF().create_value_box_tc(id(), name(), tc); 105 } 106 107 113 116 public ValueBoxDef 117 asValueBoxDef() 118 { 119 return ValueBoxDefHelper.narrow(asObject()); 120 } 121 122 128 131 protected void 132 cutDependencies() 133 { 134 original_type_def_.cutDependency(); 136 137 super.cutDependencies(); 139 } 140 141 147 150 public DefinitionKind 151 def_kind() 152 { 153 return DefinitionKind.dk_ValueBox; 154 } 155 156 162 165 public TypeCode 166 type() 167 { 168 java.util.List idSeq = new java.util.ArrayList (); 170 return recursiveType(idSeq); 171 } 172 173 179 182 public IDLType 183 original_type_def() 184 { 185 return original_type_def_.asIDLType(); 187 } 188 189 192 public void 193 original_type_def(IDLType val) 194 { 195 IRObject_impl type = castToLocal(val); 197 198 TypeCode tc = type.type(); 200 while (tc.kind() == TCKind.tk_alias) 201 { 202 try 203 { 204 tc = tc.content_type(); 205 } 206 catch(org.omg.CORBA.TypeCodePackage.BadKind exc) 207 { 208 } 209 } 210 211 TCKind tk = tc.kind(); 213 if( tk == TCKind.tk_null 214 || tk == TCKind.tk_void 215 || tk == TCKind.tk_Principal 216 || tk == TCKind.tk_except 217 || tk == TCKind.tk_native 218 || tk == TCKind.tk_abstract_interface 219 || tk == TCKind.tk_value 220 || tk == TCKind.tk_value_box) 221 throw exceptionInvalidValueBoxType(); 222 223 original_type_def_.setDependency( type ); 225 } 226 } 227 | Popular Tags |