1 26 27 package org.objectweb.ccm.IDL3; 28 29 37 38 public class ValueMemberDeclImpl 39 extends DeclarationImpl 40 implements ValueMemberDecl 41 { 42 48 51 private org.omg.CORBA.ValueMemberDef value_member_def_; 52 53 56 private TypeRef type_; 57 58 61 private short access_; 62 63 69 74 protected 75 ValueMemberDeclImpl(Repository rep, ScopeImpl parent) 76 { 77 super(rep, parent); 79 80 value_member_def_ = null; 82 type_ = null; 83 access_ = (short)0; 84 the_declaration_kind_ = DeclarationKind._dk_value_member; 85 } 86 87 93 98 protected void 99 load(org.omg.CORBA.Contained contained) 100 { 101 value_member_def_ = org.omg.CORBA.ValueMemberDefHelper.narrow(contained); 102 setType(getRepository().getAsTypeRef(value_member_def_.type_def())); 103 access_ = value_member_def_.access(); 104 super.load(contained); 105 } 106 107 113 116 public void 117 create() 118 { 119 value_member_def_ = the_parent_.getExtValueDef().create_value_member(getId(), 121 getName(), 122 getVersion(), 123 type_.getIDLType(), 124 access_); 125 126 super.create(); 127 } 128 129 136 public Declaration[] 137 getDependencies() 138 { 139 if (dependencies_!=null) 140 return dependencies_; 141 142 org.objectweb.ccm.util.Vector vmember_depend = new org.objectweb.ccm.util.Vector(); 143 144 if (getType().isDeclaration()) 146 vmember_depend.add(getType()); 147 148 Declaration[] depend = getType().getDependencies(); 149 for (int i=0;i<depend.length;i++) 150 vmember_depend.add(depend[i]); 151 152 153 dependencies_ = (Declaration[])vmember_depend.toArray(new Declaration[0]); 154 return dependencies_; 155 } 156 157 163 168 public void 169 setType(TypeRef type) 170 { 171 if(type != null) 172 { 173 type_ = type; 174 type_.addRef(); 175 } 176 } 177 178 181 public void 182 setPrivate() 183 { 184 access_ = (short)0; 185 } 186 187 190 public void 191 setPublic() 192 { 193 access_ = (short)1; 194 } 195 196 199 public TypeRef 200 getType() 201 { 202 return type_; 203 } 204 205 208 public boolean 209 isPrivate() 210 { 211 return access_==(short)0; 212 } 213 214 220 223 public void 224 destroy() 225 { 226 if (type_!=null) 227 type_.removeRef(); 228 229 super.destroy(); 230 } 231 232 238 protected org.omg.CORBA.Contained 239 getContained() 240 { 241 return value_member_def_; 242 } 243 } 244 | Popular Tags |