~ubuntu-branches/ubuntu/gutsy/icedtea-java7/gutsy-proposed

« back to all changes in this revision

Viewing changes to generated/org/omg/DynamicAny/DynAnyFactoryHelper.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2007-10-02 19:45:21 UTC
  • Revision ID: james.westby@ubuntu.com-20071002194521-sxktz6qrugbflmh9
Tags: 7~b21-1.4+20071002-0ubuntu2
Rebuild using icedtea 7~b21.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package org.omg.DynamicAny;
 
2
 
 
3
 
 
4
/**
 
5
* org/omg/DynamicAny/DynAnyFactoryHelper.java .
 
6
* Generated by the IDL-to-Java compiler (portable), version "3.2"
 
7
* from ../../../../src/share/classes/org/omg/DynamicAny/DynamicAny.idl
 
8
* Friday, May 25, 2007 3:39:58 o'clock PM GMT-05:00
 
9
*/
 
10
 
 
11
 
 
12
/**
 
13
    * DynAny objects can be created by invoking operations on the DynAnyFactory object.
 
14
    * Generally there are only two ways to create a DynAny object:
 
15
    * <UL>
 
16
    * <LI>invoking an operation on an existing DynAny object
 
17
    * <LI>invoking an operation on a DynAnyFactory object
 
18
    * </UL>
 
19
    * A constructed DynAny object supports operations that enable the creation of new DynAny
 
20
    * objects encapsulating access to the value of some constituent.
 
21
    * DynAny objects also support the copy operation for creating new DynAny objects.
 
22
    * A reference to the DynAnyFactory object is obtained by calling ORB.resolve_initial_references()
 
23
    * with the identifier parameter set to the string constant "DynAnyFactory".
 
24
    * <P>Dynamic interpretation of an any usually involves creating a DynAny object using create_dyn_any()
 
25
    * as the first step. Depending on the type of the any, the resulting DynAny object reference can be narrowed
 
26
    * to a DynFixed, DynStruct, DynSequence, DynArray, DynUnion, DynEnum, or DynValue object reference.
 
27
    * <P>Dynamic creation of an any involves creating a DynAny object using create_dyn_any_from_type_code(),
 
28
    * passing the TypeCode associated with the value to be created. The returned reference is narrowed to one of
 
29
    * the complex types, such as DynStruct, if appropriate. Then, the value can be initialized by means of
 
30
    * invoking operations on the resulting object. Finally, the to_any operation can be invoked
 
31
    * to create an any value from the constructed DynAny.
 
32
    */
 
33
abstract public class DynAnyFactoryHelper
 
34
{
 
35
  private static String  _id = "IDL:omg.org/DynamicAny/DynAnyFactory:1.0";
 
36
 
 
37
  public static void insert (org.omg.CORBA.Any a, org.omg.DynamicAny.DynAnyFactory that)
 
38
  {
 
39
    org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
 
40
    a.type (type ());
 
41
    write (out, that);
 
42
    a.read_value (out.create_input_stream (), type ());
 
43
  }
 
44
 
 
45
  public static org.omg.DynamicAny.DynAnyFactory extract (org.omg.CORBA.Any a)
 
46
  {
 
47
    return read (a.create_input_stream ());
 
48
  }
 
49
 
 
50
  private static org.omg.CORBA.TypeCode __typeCode = null;
 
51
  synchronized public static org.omg.CORBA.TypeCode type ()
 
52
  {
 
53
    if (__typeCode == null)
 
54
    {
 
55
      __typeCode = org.omg.CORBA.ORB.init ().create_interface_tc (org.omg.DynamicAny.DynAnyFactoryHelper.id (), "DynAnyFactory");
 
56
    }
 
57
    return __typeCode;
 
58
  }
 
59
 
 
60
  public static String id ()
 
61
  {
 
62
    return _id;
 
63
  }
 
64
 
 
65
  public static org.omg.DynamicAny.DynAnyFactory read (org.omg.CORBA.portable.InputStream istream)
 
66
  {
 
67
      throw new org.omg.CORBA.MARSHAL ();
 
68
  }
 
69
 
 
70
  public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.DynamicAny.DynAnyFactory value)
 
71
  {
 
72
      throw new org.omg.CORBA.MARSHAL ();
 
73
  }
 
74
 
 
75
  public static org.omg.DynamicAny.DynAnyFactory narrow (org.omg.CORBA.Object obj)
 
76
  {
 
77
    if (obj == null)
 
78
      return null;
 
79
    else if (obj instanceof org.omg.DynamicAny.DynAnyFactory)
 
80
      return (org.omg.DynamicAny.DynAnyFactory)obj;
 
81
    else if (!obj._is_a (id ()))
 
82
      throw new org.omg.CORBA.BAD_PARAM ();
 
83
    else
 
84
    {
 
85
      org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
 
86
      org.omg.DynamicAny._DynAnyFactoryStub stub = new org.omg.DynamicAny._DynAnyFactoryStub ();
 
87
      stub._set_delegate(delegate);
 
88
      return stub;
 
89
    }
 
90
  }
 
91
 
 
92
  public static org.omg.DynamicAny.DynAnyFactory unchecked_narrow (org.omg.CORBA.Object obj)
 
93
  {
 
94
    if (obj == null)
 
95
      return null;
 
96
    else if (obj instanceof org.omg.DynamicAny.DynAnyFactory)
 
97
      return (org.omg.DynamicAny.DynAnyFactory)obj;
 
98
    else
 
99
    {
 
100
      org.omg.CORBA.portable.Delegate delegate = ((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
 
101
      org.omg.DynamicAny._DynAnyFactoryStub stub = new org.omg.DynamicAny._DynAnyFactoryStub ();
 
102
      stub._set_delegate(delegate);
 
103
      return stub;
 
104
    }
 
105
  }
 
106
 
 
107
}