src/share/classes/org/omg/CORBA/WStringValueHelper.java

changeset 0
7ef37b2cdcad
child 748
6845b95cba6b
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/classes/org/omg/CORBA/WStringValueHelper.java	Wed Apr 27 01:21:28 2016 +0800
     1.3 @@ -0,0 +1,142 @@
     1.4 +/*
     1.5 + * Copyright (c) 1998, 2002, Oracle and/or its affiliates. All rights reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.  Oracle designates this
    1.11 + * particular file as subject to the "Classpath" exception as provided
    1.12 + * by Oracle in the LICENSE file that accompanied this code.
    1.13 + *
    1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 + * version 2 for more details (a copy is included in the LICENSE file that
    1.18 + * accompanied this code).
    1.19 + *
    1.20 + * You should have received a copy of the GNU General Public License version
    1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 + *
    1.24 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    1.25 + * or visit www.oracle.com if you need additional information or have any
    1.26 + * questions.
    1.27 + */
    1.28 +
    1.29 +/**
    1.30 +* The Helper for <tt>WStringValue</tt>.  For more information on
    1.31 +* Helper files, see <a href="doc-files/generatedfiles.html#helper">
    1.32 +* "Generated Files: Helper Files"</a>.<P>
    1.33 +*/
    1.34 +
    1.35 +/*
    1.36 + * Licensed Materials - Property of IBM
    1.37 + * RMI-IIOP v1.0
    1.38 + * Copyright IBM Corp. 1998 1999  All Rights Reserved
    1.39 + *
    1.40 + */
    1.41 +
    1.42 +package org.omg.CORBA;
    1.43 +
    1.44 +/**
    1.45 +* org/omg/CORBA/WStringValueHelper.java
    1.46 +* Generated by the IDL-to-Java compiler (portable), version "3.0"
    1.47 +* from orb.idl
    1.48 +* 31 May 1999 22:27:30 o'clock GMT+00:00
    1.49 +*
    1.50 +* The class definition has been modified to conform to the following
    1.51 +* OMG specifications :
    1.52 +*   <ul>
    1.53 +*       <li> ORB core as defined by CORBA 2.3.1
    1.54 +*       (<a href="http://cgi.omg.org/cgi-bin/doc?formal/99-10-07">formal/99-10-07</a>)
    1.55 +*       </li>
    1.56 +*
    1.57 +*       <li> IDL/Java Language Mapping as defined in
    1.58 +*       <a href="http://cgi.omg.org/cgi-bin/doc?ptc/00-01-08">ptc/00-01-08</a>
    1.59 +*       </li>
    1.60 +*   </ul>
    1.61 +*/
    1.62 +
    1.63 +public class WStringValueHelper implements org.omg.CORBA.portable.BoxedValueHelper
    1.64 +{
    1.65 +    private static String  _id = "IDL:omg.org/CORBA/WStringValue:1.0";
    1.66 +
    1.67 +  private static WStringValueHelper _instance = new WStringValueHelper ();
    1.68 +
    1.69 +    public static void insert (org.omg.CORBA.Any a, String that)
    1.70 +    {
    1.71 +        org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
    1.72 +        a.type (type ());
    1.73 +        write (out, that);
    1.74 +        a.read_value (out.create_input_stream (), type ());
    1.75 +    }
    1.76 +
    1.77 +    public static String extract (org.omg.CORBA.Any a)
    1.78 +    {
    1.79 +        return read (a.create_input_stream ());
    1.80 +    }
    1.81 +
    1.82 +    private static org.omg.CORBA.TypeCode __typeCode = null;
    1.83 +    private static boolean __active = false;
    1.84 +    synchronized public static org.omg.CORBA.TypeCode type ()
    1.85 +    {
    1.86 +        if (__typeCode == null)
    1.87 +            {
    1.88 +                synchronized (org.omg.CORBA.TypeCode.class)
    1.89 +                    {
    1.90 +                        if (__typeCode == null)
    1.91 +                            {
    1.92 +                                if (__active)
    1.93 +                                    {
    1.94 +                                        return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
    1.95 +                                    }
    1.96 +                                __active = true;
    1.97 +                                __typeCode = org.omg.CORBA.ORB.init ().create_wstring_tc (0);
    1.98 +                                __typeCode = org.omg.CORBA.ORB.init ().create_value_box_tc (_id, "WStringValue", __typeCode);
    1.99 +                                __active = false;
   1.100 +                            }
   1.101 +                    }
   1.102 +            }
   1.103 +        return __typeCode;
   1.104 +    }
   1.105 +
   1.106 +    public static String id ()
   1.107 +    {
   1.108 +        return _id;
   1.109 +    }
   1.110 +
   1.111 +    public static String read (org.omg.CORBA.portable.InputStream istream)
   1.112 +    {
   1.113 +    if (!(istream instanceof org.omg.CORBA_2_3.portable.InputStream)) {
   1.114 +      throw new org.omg.CORBA.BAD_PARAM(); }
   1.115 +    return (String) ((org.omg.CORBA_2_3.portable.InputStream) istream).read_value (_instance);
   1.116 +    }
   1.117 +
   1.118 +  public java.io.Serializable read_value (org.omg.CORBA.portable.InputStream istream)
   1.119 +    {
   1.120 +    String tmp;
   1.121 +    tmp = istream.read_wstring ();
   1.122 +    return (java.io.Serializable) tmp;
   1.123 +    }
   1.124 +
   1.125 +  public static void write (org.omg.CORBA.portable.OutputStream ostream, String value)
   1.126 +    {
   1.127 +    if (!(ostream instanceof org.omg.CORBA_2_3.portable.OutputStream)) {
   1.128 +      throw new org.omg.CORBA.BAD_PARAM(); }
   1.129 +    ((org.omg.CORBA_2_3.portable.OutputStream) ostream).write_value (value, _instance);
   1.130 +    }
   1.131 +
   1.132 +    public void write_value (org.omg.CORBA.portable.OutputStream ostream, java.io.Serializable value)
   1.133 +    {
   1.134 +    if (!(value instanceof String)) {
   1.135 +      throw new org.omg.CORBA.MARSHAL(); }
   1.136 +    String valueType = (String) value;
   1.137 +    ostream.write_wstring (valueType);
   1.138 +    }
   1.139 +
   1.140 +    public String get_id ()
   1.141 +    {
   1.142 +        return _id;
   1.143 +    }
   1.144 +
   1.145 +}

mercurial