1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class SequenceDef_impl 42 extends AnonymousIDLType 43 implements SequenceDefOperations 44 { 45 51 52 protected int bound_; 53 54 55 protected IDLType_ref element_type_def_; 56 57 63 64 public 65 SequenceDef_impl(IFR ifr) 66 { 67 super(ifr); 69 70 setServant(new SequenceDefPOATie(this)); 72 73 bound_ = 0; 75 76 element_type_def_ = new IDLType_ref(this); 78 } 79 80 86 90 protected TypeCode 91 recursiveType(java.util.List idSeq) 92 { 93 TypeCode tc = null; 94 try 95 { 96 Contained_impl cont = (Contained_impl)element_type_def_.getBaseImpl(); 97 int idx = idSeq.indexOf(cont.id()); 98 if (idx!=-1) 99 { 100 int dk = cont.def_kind().value(); 102 if ((dk!=DefinitionKind._dk_Struct) && 103 (dk!=DefinitionKind._dk_Exception) && 104 (dk!=DefinitionKind._dk_Union) && 105 (dk!=DefinitionKind._dk_Value) && 106 (dk!=DefinitionKind._dk_Alias)) 107 throw exceptionIllegalRecursion("anonymous sequence", cont.id()); 108 109 tc = getIFR().getTCF().create_recursive_tc(cont.id()); 110 } 111 } 112 catch (java.lang.ClassCastException ex) 113 { 114 } 115 116 if (tc==null) 117 tc = element_type_def_.recursiveType(idSeq); 118 119 return getIFR().getTCF().create_sequence_tc(bound(), tc); 120 } 121 122 128 131 public SequenceDef 132 asSequenceDef() 133 { 134 return SequenceDefHelper.narrow(asObject()); 135 } 136 137 143 146 protected void 147 cutDependencies() 148 { 149 element_type_def_.cutDependency(); 151 152 super.cutDependencies(); 154 } 155 156 162 165 public DefinitionKind 166 def_kind() 167 { 168 return DefinitionKind.dk_Sequence; 169 } 170 171 177 180 public TypeCode 181 type() 182 { 183 java.util.List idSeq = new java.util.ArrayList (); 185 return recursiveType(idSeq); 186 } 187 188 194 197 public int 198 bound() 199 { 200 return bound_; 201 } 202 203 public void 204 bound(int b) 205 { 206 bound_ = b; 207 } 208 209 212 public TypeCode 213 element_type() 214 { 215 return element_type_def_.recursiveType(); 217 } 218 219 222 public IDLType 223 element_type_def() 224 { 225 return element_type_def_.asIDLType(); 227 } 228 229 232 public void 233 element_type_def(IDLType val) 234 { 235 element_type_def_.setDependency( castToLocal(val) ); 238 } 239 } 240 | Popular Tags |