1 26 27 package org.objectweb.openccm.ir3; 28 29 import org.omg.CORBA.*; 31 32 40 41 public class ConstantDef_impl 42 extends Contained_impl 43 implements ConstantDefOperations 44 { 45 51 52 protected IDLType_ref type_def_; 53 54 55 protected Any value_; 56 57 63 66 public 67 ConstantDef_impl(IFR ifr, 68 Container_impl container) 69 { 70 super(ifr, container); 72 73 setServant(new ConstantDefPOATie(this)); 75 76 type_def_ = new IDLType_ref(this); 78 79 value_ = null; 81 } 82 83 89 92 public ConstantDef 93 asConstantDef() 94 { 95 return ConstantDefHelper.narrow(asObject()); 96 } 97 98 104 107 public void 108 setDescriptionValue(Any any) 109 { 110 ConstantDescription description = new ConstantDescription(); 112 description.name = name(); 113 description.id = id(); 114 description.defined_in = getContainerID(); 115 description.version = version(); 116 description.type = type(); 117 description.value = value(); 118 119 ConstantDescriptionHelper.insert(any, description); 121 } 122 123 129 132 protected void 133 cutDependencies() 134 { 135 type_def_.cutDependency(); 137 138 value_ = null; 139 140 super.cutDependencies(); 142 } 143 144 150 153 public DefinitionKind 154 def_kind() 155 { 156 return DefinitionKind.dk_Constant; 157 } 158 159 165 168 public TypeCode 169 type() 170 { 171 return type_def_.recursiveType(); 173 } 174 175 178 public IDLType 179 type_def() 180 { 181 return type_def_.asIDLType(); 183 } 184 185 188 public void 189 type_def(IDLType val) 190 { 191 type_def_.setDependency( castToLocal(val) ); 194 } 195 196 199 public Any 200 value() 201 { 202 if (value_ == null) 203 throw exceptionBadInvOrder("IDL:omg.org/CORBA/ConstantDef/value:1.0"); 204 205 return value_; 206 } 207 208 211 public void 212 value(Any val) 213 { 214 if (!val.type().equivalent(type())) 217 throw exceptionBadParam("IDL:omg.org/CORBA/ConstantDef/value:1.0"); 219 220 value_ = val; 221 } 222 } 223 | Popular Tags |