home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / TRIAL / JBUILDER / JVISBRKR.Z / CreditApprovalExceptionHelper.java < prev    next >
Encoding:
Java Source  |  1998-05-08  |  3.6 KB  |  78 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.CreditApprovalExceptionHelper
  25. <li> <b>Source File</b> borland/reference/creditapproval/CORBAInterface/CreditApprovalExceptionHelper.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::CreditApprovalException
  28. <li> <b>Repository Identifier</b> IDL:borland/reference/creditapproval/CORBAInterface/CreditApprovalException:1.0
  29. </ul>
  30. <b>IDL definition:</b>
  31. <pre>
  32.     exception CreditApprovalException {
  33.       string reason;
  34.     };
  35. </pre>
  36. </p>
  37. */
  38. abstract public class CreditApprovalExceptionHelper {
  39.   private static org.omg.CORBA.ORB _orb() {
  40.     return org.omg.CORBA.ORB.init();
  41.   }
  42.   public static borland.reference.creditapproval.CORBAInterface.CreditApprovalException read(org.omg.CORBA.portable.InputStream _input) {
  43.     if(!_input.read_string().equals(id())) {
  44.       throw new org.omg.CORBA.MARSHAL("Mismached repository id");
  45.     }
  46.     borland.reference.creditapproval.CORBAInterface.CreditApprovalException result = new borland.reference.creditapproval.CORBAInterface.CreditApprovalException();
  47.     result.reason = _input.read_string();
  48.     return result;
  49.   }
  50.   public static void write(org.omg.CORBA.portable.OutputStream _output, borland.reference.creditapproval.CORBAInterface.CreditApprovalException value) {
  51.     _output.write_string(id());
  52.     _output.write_string(value.reason);
  53.   }
  54.   public static void insert(org.omg.CORBA.Any any, borland.reference.creditapproval.CORBAInterface.CreditApprovalException value) {
  55.     org.omg.CORBA.portable.OutputStream output = any.create_output_stream();
  56.     write(output, value);
  57.     any.read_value(output.create_input_stream(), type());
  58.   }
  59.   public static borland.reference.creditapproval.CORBAInterface.CreditApprovalException extract(org.omg.CORBA.Any any) {
  60.     if(!any.type().equal(type())) {
  61.       throw new org.omg.CORBA.BAD_TYPECODE();
  62.     }
  63.     return read(any.create_input_stream());
  64.   }
  65.   private static org.omg.CORBA.TypeCode _type;
  66.   public static org.omg.CORBA.TypeCode type() {
  67.     if(_type == null) {
  68.       org.omg.CORBA.StructMember[] members = new org.omg.CORBA.StructMember[1];
  69.       members[0] = new org.omg.CORBA.StructMember("reason", _orb().get_primitive_tc(org.omg.CORBA.TCKind.tk_string), null);
  70.       _type = _orb().create_exception_tc(id(), "CreditApprovalException", members);
  71.     }
  72.     return _type;
  73.   }
  74.   public static java.lang.String id() {
  75.     return "IDL:borland/reference/creditapproval/CORBAInterface/CreditApprovalException:1.0";
  76.   }
  77. }
  78.