1 7 8 package com.sun.corba.se.impl.dynamicany; 9 10 import org.omg.CORBA.TypeCode ; 11 import org.omg.CORBA.TCKind ; 12 import org.omg.CORBA.Any ; 13 import org.omg.CORBA.TypeCodePackage.BadKind ; 14 import org.omg.CORBA.TypeCodePackage.Bounds ; 15 import org.omg.DynamicAny.*; 16 import org.omg.DynamicAny.DynAnyPackage.TypeMismatch ; 17 import org.omg.DynamicAny.DynAnyPackage.InvalidValue ; 18 import org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode ; 19 20 import com.sun.corba.se.spi.orb.ORB ; 21 import com.sun.corba.se.spi.logging.CORBALogDomains ; 22 import com.sun.corba.se.impl.logging.ORBUtilSystemException ; 23 24 abstract class DynValueCommonImpl extends DynAnyComplexImpl implements DynValueCommon 25 { 26 30 protected boolean isNull; 31 32 private DynValueCommonImpl() { 33 this(null, (Any )null, false); 34 isNull = true; 35 } 36 37 protected DynValueCommonImpl(ORB orb, Any any, boolean copyValue) { 38 super(orb, any, copyValue); 39 isNull = checkInitComponents(); 40 } 41 42 protected DynValueCommonImpl(ORB orb, TypeCode typeCode) { 43 super(orb, typeCode); 44 isNull = true; 45 } 46 47 51 public boolean is_null() { 53 return isNull; 54 } 55 56 public void set_to_null() { 58 isNull = true; 59 clearData(); 60 } 61 62 public void set_to_value() { 67 if (isNull) { 68 isNull = false; 69 } 71 } 73 74 78 public org.omg.DynamicAny.NameValuePair [] get_members () 80 throws org.omg.DynamicAny.DynAnyPackage.InvalidValue 81 { 82 if (status == STATUS_DESTROYED) { 83 throw wrapper.dynAnyDestroyed() ; 84 } 85 if (isNull) { 86 throw new InvalidValue (); 87 } 88 checkInitComponents(); 89 return nameValuePairs; 90 } 91 92 public org.omg.DynamicAny.NameDynAnyPair [] get_members_as_dyn_any () 94 throws org.omg.DynamicAny.DynAnyPackage.InvalidValue 95 { 96 if (status == STATUS_DESTROYED) { 97 throw wrapper.dynAnyDestroyed() ; 98 } 99 if (isNull) { 100 throw new InvalidValue (); 101 } 102 checkInitComponents(); 103 return nameDynAnyPairs; 104 } 105 106 110 public void set_members (org.omg.DynamicAny.NameValuePair [] value) 112 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 113 org.omg.DynamicAny.DynAnyPackage.InvalidValue 114 { 115 super.set_members(value); 116 isNull = false; 118 } 119 120 public void set_members_as_dyn_any (org.omg.DynamicAny.NameDynAnyPair [] value) 122 throws org.omg.DynamicAny.DynAnyPackage.TypeMismatch , 123 org.omg.DynamicAny.DynAnyPackage.InvalidValue 124 { 125 super.set_members_as_dyn_any(value); 126 isNull = false; 128 } 129 } 130 | Popular Tags |