1 /*
   2  * Copyright (c) 1999, 2001, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package org.omg.CORBA;
  26 
  27 
  28 /**
  29 * The Helper for <tt>NameValuePair</tt>.  For more information on
  30 * Helper files, see <a href="doc-files/generatedfiles.html#helper">
  31 * "Generated Files: Helper Files"</a>.<P>
  32 * org/omg/CORBA/NameValuePairHelper.java
  33 * Generated by the IDL-to-Java compiler (portable), version "3.0"
  34 * 03 June 1999 11:52:03 o'clock GMT+00:00
  35 */
  36 
  37 abstract public class NameValuePairHelper
  38 {
  39   private static String  _id = "IDL:omg.org/CORBA/NameValuePair:1.0";
  40 
  41   public static void insert (org.omg.CORBA.Any a, org.omg.CORBA.NameValuePair that)
  42   {
  43     org.omg.CORBA.portable.OutputStream out = a.create_output_stream ();
  44     a.type (type ());
  45     write (out, that);
  46     a.read_value (out.create_input_stream (), type ());
  47   }
  48 
  49   public static org.omg.CORBA.NameValuePair extract (org.omg.CORBA.Any a)
  50   {
  51     return read (a.create_input_stream ());
  52   }
  53 
  54   private static org.omg.CORBA.TypeCode __typeCode = null;
  55   private static boolean __active = false;
  56   synchronized public static org.omg.CORBA.TypeCode type ()
  57   {
  58     if (__typeCode == null)
  59     {
  60       synchronized (org.omg.CORBA.TypeCode.class)
  61       {
  62         if (__typeCode == null)
  63         {
  64           if (__active)
  65           {
  66             return org.omg.CORBA.ORB.init().create_recursive_tc ( _id );
  67           }
  68           __active = true;
  69           org.omg.CORBA.StructMember[] _members0 = new org.omg.CORBA.StructMember [2];
  70           org.omg.CORBA.TypeCode _tcOf_members0 = null;
  71           _tcOf_members0 = org.omg.CORBA.ORB.init ().create_string_tc (0);
  72           _tcOf_members0 = org.omg.CORBA.ORB.init ().create_alias_tc (org.omg.CORBA.FieldNameHelper.id (), "FieldName", _tcOf_members0);
  73           _members0[0] = new org.omg.CORBA.StructMember (
  74             "id",
  75             _tcOf_members0,
  76             null);
  77           _tcOf_members0 = org.omg.CORBA.ORB.init ().get_primitive_tc (org.omg.CORBA.TCKind.tk_any);
  78           _members0[1] = new org.omg.CORBA.StructMember (
  79             "value",
  80             _tcOf_members0,
  81             null);
  82           __typeCode = org.omg.CORBA.ORB.init ().create_struct_tc (org.omg.CORBA.NameValuePairHelper.id (), "NameValuePair", _members0);
  83           __active = false;
  84         }
  85       }
  86     }
  87     return __typeCode;
  88   }
  89 
  90   public static String id ()
  91   {
  92     return _id;
  93   }
  94 
  95   public static org.omg.CORBA.NameValuePair read (org.omg.CORBA.portable.InputStream istream)
  96   {
  97     org.omg.CORBA.NameValuePair value = new org.omg.CORBA.NameValuePair ();
  98     value.id = istream.read_string ();
  99     value.value = istream.read_any ();
 100     return value;
 101   }
 102 
 103   public static void write (org.omg.CORBA.portable.OutputStream ostream, org.omg.CORBA.NameValuePair value)
 104   {
 105     ostream.write_string (value.id);
 106     ostream.write_any (value.value);
 107   }
 108 
 109 }