Java Card 2.1 Platform
Final Revision 1.0

javacard.framework
Class CardRuntimeException

java.lang.Object
  |
  +--java.lang.Throwable
        |
        +--java.lang.Exception
              |
              +--java.lang.RuntimeException
                    |
                    +--javacard.framework.CardRuntimeException
Direct Known Subclasses:
APDUException, CryptoException, ISOException, PINException, SystemException, TransactionException

public class CardRuntimeException
extends RuntimeException

The CardRuntimeException class defines a field reason and two accessor methods getReason() and setReason(). The reason field encapulates exception cause identifier in Java Card. All Java Card unchecked Exception classes should extend CardRuntimeException. This class also provides a resource-saving mechanism (throwIt() method) for using a JCRE owned instance of this class.


Constructor Summary
CardRuntimeException(short reason)
          Construct a CardRuntimeException instance with the specified reason.
 
Method Summary
 short getReason()
          Get reason code
 void setReason(short reason)
          Set reason code
static void throwIt(short reason)
          Throw the JCRE owned instance of the CardRuntimeException class with the specified reason.
 
Methods inherited from class java.lang.Object
equals
 

Constructor Detail

CardRuntimeException

public CardRuntimeException(short reason)
Construct a CardRuntimeException instance with the specified reason. To conserve on resources, use throwIt() method to use the JCRE owned instance of this class.
Parameters:
reason - the reason for the exception
Method Detail

getReason

public short getReason()
Get reason code
Returns:
the reason for the exception

setReason

public void setReason(short reason)
Set reason code
Parameters:
reason - the reason for the exception

throwIt

public static void throwIt(short reason)
                    throws CardRuntimeException
Throw the JCRE owned instance of the CardRuntimeException class with the specified reason.

JCRE owned instances of exception classes are temporary JCRE Entry Point Objects and can be accessed from any applet context. References to these temporary objects cannot be stored in class variables or instance variables or array components. See Java Card Runtime Environment (JCRE) 2.1 Specification for details.

Parameters:
reason - the reason for the exception
Throws:
CardRuntimeException - always.

Submit a bug or feature

Java and Java Card are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1999 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
All Rights Reserved.