1 26 27 package org.objectweb.openccm.ast.lib; 28 29 30 import org.objectweb.openccm.ast.api.TypeKind; 31 32 33 import org.objectweb.openccm.ast.api.DeclarationKind; 34 35 36 import org.objectweb.openccm.ast.api.Declaration; 37 38 39 import org.omg.CORBA.ValueBoxDef ; 40 import org.omg.CORBA.ValueBoxDefHelper; 41 42 54 55 public class ValueBoxDeclImpl 56 extends DeclarationWithTypeRefImpl 57 implements org.objectweb.openccm.ast.api.ValueBoxDecl, 58 IDLTypeWrapper 59 { 60 66 67 private ValueBoxDef value_box_def_; 68 69 75 81 protected 82 ValueBoxDeclImpl(Repository rep, 83 ScopeImpl parent) 84 { 85 super(rep, parent); 87 88 value_box_def_ = null; 90 } 91 92 98 104 109 protected void 110 load(org.omg.CORBA.Contained contained) 111 { 112 value_box_def_ = ValueBoxDefHelper.narrow(contained); 113 setType(getRepository(). 114 getAsTypeRef(value_box_def_.original_type_def())); 115 super.load(contained); 116 } 117 118 123 protected void 124 loadAsMapping(org.omg.CORBA.Contained contained) 125 { 126 value_box_def_ = ValueBoxDefHelper.narrow(contained); 127 setType(getRepository(). 128 getAsMappedTypeRef(value_box_def_.original_type_def())); 129 super.loadAsMapping(contained); 130 } 131 132 138 protected org.omg.CORBA.Contained 139 getContained() 140 { 141 return value_box_def_; 142 } 143 144 150 156 164 public Declaration[] 165 getDependencies() 166 { 167 if (dependencies_!=null) 168 return dependencies_; 169 170 java.util.List vbox_depend = new java.util.ArrayList (); 171 172 if (getType().isDeclaration()) 174 vbox_depend.add(getType()); 175 176 Declaration[] depend = getType().getDependencies(); 177 for (int i=0;i<depend.length;i++) 178 vbox_depend.add(depend[i]); 179 180 dependencies_ = (Declaration[])vbox_depend.toArray(new Declaration[0]); 181 return dependencies_; 182 } 183 184 190 195 public long 196 getDeclKind() 197 { 198 return DeclarationKind.dk_value_box; 199 } 200 201 204 public void 205 create() 206 { 207 value_box_def_ = the_parent_.getContainer(). 208 create_value_box(getId(), 209 getName(), 210 getVersion(), 211 super.getIDLType()); 212 super.create(); 213 } 214 215 221 226 public TypeKind 227 getTypeKind() 228 { 229 return TypeKind.tk_value_box; 230 } 231 232 238 244 249 public org.omg.CORBA.IDLType 250 getIDLType() 251 { 252 return value_box_def_; 253 } 254 } 255 | Popular Tags |