package org.dbxml.core.corba.db;

/**
 *	Generated from IDL definition of exception "APIException"
 *	@author JacORB IDL compiler 
 */

public class APIExceptionHelper
{
	private static org.omg.CORBA.TypeCode _type = org.omg.CORBA.ORB.init().create_struct_tc(org.dbxml.core.corba.db.APIExceptionHelper.id(),"APIException",new org.omg.CORBA.StructMember[]{new org.omg.CORBA.StructMember("faultCode",org.omg.CORBA.ORB.init().get_primitive_tc(org.omg.CORBA.TCKind.from_int(3)),null),new org.omg.CORBA.StructMember("faultMessage",org.omg.CORBA.ORB.init().create_string_tc(0),null),new org.omg.CORBA.StructMember("exceptionMessage",org.omg.CORBA.ORB.init().create_string_tc(0),null)});
	public APIExceptionHelper ()
	{
	}
	public static void insert(org.omg.CORBA.Any any, org.dbxml.core.corba.db.APIException s)
	{
		any.type(type());
		write( any.create_output_stream(),s);
	}
	public static org.dbxml.core.corba.db.APIException extract(org.omg.CORBA.Any any)
	{
		return read(any.create_input_stream());
	}
	public static org.omg.CORBA.TypeCode type()
	{
		return _type;
	}
	public static String id()
	{
		return "IDL:org/dbxml/core/corba/db/APIException:1.0";
	}
	public static org.dbxml.core.corba.db.APIException read(org.omg.CORBA.portable.InputStream in)
	{
		org.dbxml.core.corba.db.APIException result = new org.dbxml.core.corba.db.APIException();
		if(!in.read_string().equals(id())) throw new org.omg.CORBA.MARSHAL("wrong id");
		result.faultCode=in.read_long();
		result.faultMessage=in.read_string();
		result.exceptionMessage=in.read_string();
		return result;
	}
	public static void write(org.omg.CORBA.portable.OutputStream out, org.dbxml.core.corba.db.APIException s)
	{
		out.write_string(id());
		out.write_long(s.faultCode);
		out.write_string(s.faultMessage);
		out.write_string(s.exceptionMessage);
	}
}
