home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / TRIAL / JBUILDER / JVISBRKR.Z / creditApprovalStructHelper.java < prev    next >
Encoding:
Java Source  |  1998-05-08  |  4.1 KB  |  86 lines

  1. /*
  2.  * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
  3.  * 
  4.  * This SOURCE CODE FILE, which has been provided by Borland as part
  5.  * of a Borland product for use ONLY by licensed users of the product,
  6.  * includes CONFIDENTIAL and PROPRIETARY information of Borland.  
  7.  *
  8.  * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS 
  9.  * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
  10.  * THE PRODUCT.
  11.  *
  12.  * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
  13.  * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
  14.  * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
  15.  * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
  16.  * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
  17.  * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
  18.  * CODE FILE.
  19.  */
  20. package borland.reference.creditapproval.CORBAInterface;
  21. /**
  22. <p>
  23. <ul>
  24. <li> <b>Java Class</b> borland.reference.creditapproval.CORBAInterface.creditApprovalStructHelper
  25. <li> <b>Source File</b> borland/reference/creditapproval/CORBAInterface/creditApprovalStructHelper.java
  26. <li> <b>IDL Source File</b> C:/JBuilder/samples/borland/reference/creditapproval/CreditApproval.idl
  27. <li> <b>IDL Absolute Name</b> ::borland::reference::creditapproval::CORBAInterface::creditApprovalStruct
  28. <li> <b>Repository Identifier</b> IDL:borland/reference/creditapproval/CORBAInterface/creditApprovalStruct:1.0
  29. </ul>
  30. <b>IDL definition:</b>
  31. <pre>
  32.     struct creditApprovalStruct {
  33.       boolean approved;
  34.       string creditCardNumber;
  35.       string expirationDate;
  36.       double limit;
  37.     };
  38. </pre>
  39. </p>
  40. */
  41. abstract public class creditApprovalStructHelper {
  42.   private static org.omg.CORBA.ORB _orb() {
  43.     return org.omg.CORBA.ORB.init();
  44.   }
  45.   public static borland.reference.creditapproval.CORBAInterface.creditApprovalStruct read(org.omg.CORBA.portable.InputStream _input) {
  46.     borland.reference.creditapproval.CORBAInterface.creditApprovalStruct result = new borland.reference.creditapproval.CORBAInterface.creditApprovalStruct();
  47.     result.approved = _input.read_boolean();
  48.     result.creditCardNumber = _input.read_string();
  49.     result.expirationDate = _input.read_string();
  50.     result.limit = _input.read_double();
  51.     return result;
  52.   }
  53.   public static void write(org.omg.CORBA.portable.OutputStream _output, borland.reference.creditapproval.CORBAInterface.creditApprovalStruct value) {
  54.     _output.write_boolean(value.approved);
  55.     _output.write_string(value.creditCardNumber);
  56.     _output.write_string(value.expirationDate);
  57.     _output.write_double(value.limit);
  58.   }
  59.   public static void insert(org.omg.CORBA.Any any, borland.reference.creditapproval.CORBAInterface.creditApprovalStruct value) {
  60.     org.omg.CORBA.portable.OutputStream output = any.create_output_stream();
  61.     write(output, value);
  62.     any.read_value(output.create_input_stream(), type());
  63.   }
  64.   public static borland.reference.creditapproval.CORBAInterface.creditApprovalStruct extract(org.omg.CORBA.Any any) {
  65.     if(!any.type().equal(type())) {
  66.       throw new org.omg.CORBA.BAD_TYPECODE();
  67.     }
  68.     return read(any.create_input_stream());
  69.   }
  70.   private static org.omg.CORBA.TypeCode _type;
  71.   public static org.omg.CORBA.TypeCode type() {
  72.     if(_type == null) {
  73.       org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[4];
  74.       members[0] = new org.omg.CORBA.StructMember("approved", _orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_boolean), null);
  75.       members[1] = new org.omg.CORBA.StructMember("creditCardNumber", _orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_string), null);
  76.       members[2] = new org.omg.CORBA.StructMember("expirationDate", _orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_string), null);
  77.       members[3] = new org.omg.CORBA.StructMember("limit", _orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_double), null);
  78.       _type = _orb().create_struct_tc(id(), "creditApprovalStruct", members);
  79.     }
  80.     return _type;
  81.   }
  82.   public static java.lang.String id() {
  83.     return "IDL:borland/reference/creditapproval/CORBAInterface/creditApprovalStruct:1.0";
  84.   }
  85. }
  86.