KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > omg > DynamicAny > DynValueHelper


1 package org.omg.DynamicAny;
2
3
4 /**
5 * org/omg/DynamicAny/DynValueHelper.java .
6 * Generated by the IDL-to-Java compiler (portable), version "3.2"
7 * from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl
8 * Saturday, February 9, 2008 9:40:12 AM GMT
9 */

10
11
12 /**
13     * DynValue objects support the manipulation of IDL non-boxed value types.
14     * The DynValue interface can represent both null and non-null value types.
15     * For a DynValue representing a non-null value type, the DynValue's components comprise
16     * the public and private members of the value type, including those inherited from concrete base value types,
17     * in the order of definition. A DynValue representing a null value type has no components
18     * and a current position of -1.
19     * <P>Warning: Indiscriminantly changing the contents of private value type members can cause the value type
20     * implementation to break by violating internal constraints. Access to private members is provided to support
21     * such activities as ORB bridging and debugging and should not be used to arbitrarily violate
22     * the encapsulation of the value type.
23     */

24 abstract public class DynValueHelper
25 {
26   private static String JavaDoc _id = "IDL:omg.org/DynamicAny/DynValue:1.0";
27
28   public static void insert (org.omg.CORBA.Any JavaDoc a, org.omg.DynamicAny.DynValue JavaDoc that)
29   {
30     org.omg.CORBA.portable.OutputStream JavaDoc out = a.create_output_stream ();
31     a.type (type ());
32     write (out, that);
33     a.read_value (out.create_input_stream (), type ());
34   }
35
36   public static org.omg.DynamicAny.DynValue JavaDoc extract (org.omg.CORBA.Any JavaDoc a)
37   {
38     return read (a.create_input_stream ());
39   }
40
41   private static org.omg.CORBA.TypeCode JavaDoc __typeCode = null;
42   synchronized public static org.omg.CORBA.TypeCode JavaDoc type ()
43   {
44     if (__typeCode == null)
45     {
46       __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynValueHelper.id (), "DynValue");
47     }
48     return __typeCode;
49   }
50
51   public static String JavaDoc id ()
52   {
53     return _id;
54   }
55
56   public static org.omg.DynamicAny.DynValue JavaDoc read (org.omg.CORBA.portable.InputStream JavaDoc istream)
57   {
58       throw new org.omg.CORBA.MARSHAL JavaDoc ();
59   }
60
61   public static void write (org.omg.CORBA.portable.OutputStream JavaDoc ostream, org.omg.DynamicAny.DynValue JavaDoc value)
62   {
63       throw new org.omg.CORBA.MARSHAL JavaDoc ();
64   }
65
66   public static org.omg.DynamicAny.DynValue JavaDoc narrow (org.omg.CORBA.Object JavaDoc obj)
67   {
68     if (obj == null)
69       return null;
70     else if (obj instanceof org.omg.DynamicAny.DynValue JavaDoc)
71       return (org.omg.DynamicAny.DynValue JavaDoc)obj;
72     else if (!obj._is_a (id ()))
73       throw new org.omg.CORBA.BAD_PARAM JavaDoc ();
74     else
75     {
76       org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc)obj)._get_delegate ();
77       org.omg.DynamicAny._DynValueStub JavaDoc stub = new org.omg.DynamicAny._DynValueStub JavaDoc ();
78       stub._set_delegate(delegate);
79       return stub;
80     }
81   }
82
83   public static org.omg.DynamicAny.DynValue JavaDoc unchecked_narrow (org.omg.CORBA.Object JavaDoc obj)
84   {
85     if (obj == null)
86       return null;
87     else if (obj instanceof org.omg.DynamicAny.DynValue JavaDoc)
88       return (org.omg.DynamicAny.DynValue JavaDoc)obj;
89     else
90     {
91       org.omg.CORBA.portable.Delegate JavaDoc delegate = ((org.omg.CORBA.portable.ObjectImpl JavaDoc)obj)._get_delegate ();
92       org.omg.DynamicAny._DynValueStub JavaDoc stub = new org.omg.DynamicAny._DynValueStub JavaDoc ();
93       stub._set_delegate(delegate);
94       return stub;
95     }
96   }
97
98 }
99
Popular Tags