Пример #1
0
 public org.omg.DynamicAny.DynAny create_dyn_any_from_type_code(org.omg.CORBA.TypeCode type)
     throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode {
   try {
     switch (type.kind().value()) {
       case TCKind._tk_enum:
         return new DynEnum((org.jacorb.orb.ORB) _orb(), _this(), type).copy();
       case TCKind._tk_struct:
         return new DynStruct((org.jacorb.orb.ORB) _orb(), _this(), type).copy();
       case TCKind._tk_sequence:
         return new DynSequence((org.jacorb.orb.ORB) _orb(), _this(), type).copy();
       case TCKind._tk_union:
         return new DynUnion((org.jacorb.orb.ORB) _orb(), _this(), type).copy();
       case TCKind._tk_array:
         return new DynArray((org.jacorb.orb.ORB) _orb(), _this(), type).copy();
       default:
         return new DynAny((org.jacorb.orb.ORB) _orb(), _this(), type).copy();
     }
   } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue iv) {
     iv.printStackTrace();
   } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch itc) {
     org.jacorb.util.Debug.output(3, itc);
     throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();
   }
   return null;
 }
Пример #2
0
 public org.omg.DynamicAny.DynAny create_dyn_any(org.omg.CORBA.Any value)
     throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode {
   try {
     switch (value.type().kind().value()) {
       case org.omg.CORBA.TCKind._tk_except:
       case org.omg.CORBA.TCKind._tk_struct:
         org.omg.DynamicAny.DynStructPOATie dst =
             new org.omg.DynamicAny.DynStructPOATie(
                 new DynStruct((org.jacorb.orb.ORB) _orb(), _this(), (org.jacorb.orb.Any) value));
         dst._this_object(_orb());
         return dst._this();
       case org.omg.CORBA.TCKind._tk_enum:
         org.omg.DynamicAny.DynEnumPOATie det =
             new org.omg.DynamicAny.DynEnumPOATie(
                 new DynEnum((org.jacorb.orb.ORB) _orb(), _this(), (org.jacorb.orb.Any) value));
         det._this_object(_orb());
         return det._this();
       case org.omg.CORBA.TCKind._tk_array:
         org.omg.DynamicAny.DynArrayPOATie dyn_array_tie =
             new org.omg.DynamicAny.DynArrayPOATie(
                 new DynArray((org.jacorb.orb.ORB) _orb(), _this(), (org.jacorb.orb.Any) value));
         dyn_array_tie._this_object(_orb());
         return dyn_array_tie._this();
       case org.omg.CORBA.TCKind._tk_sequence:
         org.omg.DynamicAny.DynSequencePOATie dsqt =
             new org.omg.DynamicAny.DynSequencePOATie(
                 new DynSequence(
                     (org.jacorb.orb.ORB) _orb(), _this(), (org.jacorb.orb.Any) value));
         dsqt._this_object(_orb());
         return dsqt._this();
       case org.omg.CORBA.TCKind._tk_union:
         org.omg.DynamicAny.DynUnionPOATie dyn_union_tie =
             new org.omg.DynamicAny.DynUnionPOATie(
                 new DynUnion((org.jacorb.orb.ORB) _orb(), _this(), (org.jacorb.orb.Any) value));
         dyn_union_tie._this_object(_orb());
         return dyn_union_tie._this();
       default:
         org.omg.DynamicAny.DynAnyPOATie dat =
             new org.omg.DynamicAny.DynAnyPOATie(
                 new DynAny((org.jacorb.orb.ORB) _orb(), _this(), (org.jacorb.orb.Any) value));
         dat._this_object(_orb());
         return dat._this();
     }
   } catch (org.omg.DynamicAny.DynAnyPackage.InvalidValue iv) {
     iv.printStackTrace();
   } catch (org.omg.DynamicAny.DynAnyPackage.TypeMismatch itc) {
     itc.printStackTrace();
     throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();
   }
   return null;
 }