1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class UnionDef_impl 42 extends Container_impl 43 implements UnionDefOperations 44 { 45 51 52 protected IDLType_ref discriminator_type_def_; 53 54 55 protected UnionMembers members_; 56 57 63 64 public 65 UnionDef_impl(IFR ifr, 66 Container_impl container) 67 { 68 super(ifr, container); 70 71 setServant(new UnionDefPOATie(this)); 73 74 discriminator_type_def_ = new IDLType_ref(this); 76 members_ = new UnionMembers(this); 77 } 78 79 85 89 protected TypeCode 90 recursiveType(java.util.List idSeq) 91 { 92 int idx = idSeq.indexOf(id()); 93 if (idx!=-1) 94 return getIFR().getTCF().create_recursive_tc(id()); 95 96 idSeq.add(id()); 97 UnionMember[] members = members_.getUnionMemberSeq(idSeq); 98 idSeq.remove(id()); 99 100 return getIFR().getTCF().create_union_tc(id(), name(), 102 discriminator_type(), 103 members); 104 } 105 106 112 115 public UnionDef 116 asUnionDef() 117 { 118 return UnionDefHelper.narrow(asObject()); 119 } 120 121 127 130 public boolean 131 checkDefinitionKind(DefinitionKind dk) 132 { 133 return (dk == DefinitionKind.dk_Struct) 135 || (dk == DefinitionKind.dk_Union) 136 || (dk == DefinitionKind.dk_Enum); 137 } 138 139 142 public void 143 checkName(String name, 144 boolean exclude_inherited, 145 boolean in_inherited) 146 { 147 super.checkName(name, exclude_inherited, in_inherited); 149 150 members_.checkName(name); 152 } 153 154 160 163 protected void 164 cutDependencies() 165 { 166 discriminator_type_def_.cutDependency(); 168 169 members_.cutDependencies(); 171 172 super.cutDependencies(); 174 } 175 176 182 185 public DefinitionKind 186 def_kind() 187 { 188 return DefinitionKind.dk_Union; 189 } 190 191 197 200 public TypeCode 201 type() 202 { 203 java.util.List idSeq = new java.util.ArrayList (); 205 return recursiveType(idSeq); 206 } 207 208 214 220 223 public TypeCode 224 discriminator_type() 225 { 226 return discriminator_type_def_.recursiveType(); 228 } 229 230 233 public IDLType 234 discriminator_type_def() 235 { 236 return discriminator_type_def_.asIDLType(); 238 } 239 240 243 public void 244 discriminator_type_def(IDLType val) 245 { 246 if (val == null) 248 discriminator_type_def_.setDependency(null); 249 else 250 discriminator_type_def_.setDependency( castToLocal(val) ); 253 } 254 255 258 public UnionMember[] 259 members() 260 { 261 return members_.getUnionMemberSeq(); 263 } 264 265 268 public void 269 members(UnionMember[] val) 270 { 271 members_.setUnionMemberSeq(val); 273 } 274 } 275 | Popular Tags |