Package javacard.framework
Class CardRuntimeException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javacard.framework.CardRuntimeException
-
- Direct Known Subclasses:
APDUException
,Bio1toNException
,BioException
,CertificateException
,CryptoException
,DateTimeException
,ExternalException
,ISOException
,PINException
,ServiceException
,StringException
,SystemException
,TLVException
,TransactionException
,UtilException
public class CardRuntimeException extends RuntimeException
TheCardRuntimeException
class defines a fieldreason
and two accessor methodsgetReason()
andsetReason()
. Thereason
field encapsulates an exception cause identifier in the Java Card platform. All Java Card platform unchecked Exception classes should extendCardRuntimeException
. This class also provides a resource-saving mechanism (throwIt()
method) for using a Java Card runtime environment-owned instance of this class.Even if a transaction is in progress, the update of the internal
reason
field shall not participate in the transaction. The value of the internalreason
field of Java Card runtime environment-owned instance is reset to 0 on a tear or reset.
-
-
Constructor Summary
Constructors Constructor Description CardRuntimeException(short reason)
Constructs a CardRuntimeException instance with the specified reason.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description short
getReason()
Gets the reason codevoid
setReason(short reason)
Sets the reason code.static void
throwIt(short reason)
Throws the Java Card runtime environment-owned instance of theCardRuntimeException
class with the specified reason.
-
-
-
Constructor Detail
-
CardRuntimeException
public CardRuntimeException(short reason)
Constructs a CardRuntimeException instance with the specified reason. To conserve on resources, use thethrowIt()
method to employ the Java Card runtime environment-owned instance of this class.- Parameters:
reason
- the reason for the exception
-
-
Method Detail
-
getReason
public short getReason()
Gets the reason code- Returns:
- the reason for the exception
-
setReason
public void setReason(short reason)
Sets the reason code. Even if a transaction is in progress, the update of the internalreason
field shall not participate in the transaction.- Parameters:
reason
- the reason for the exception
-
throwIt
public static void throwIt(short reason) throws CardRuntimeException
Throws the Java Card runtime environment-owned instance of theCardRuntimeException
class with the specified reason.Java Card runtime environment-owned instances of exception classes are temporary Java Card runtime environment 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 Runtime Environment Specification, Java Card Platform, Classic Edition, section 6.2.1 for details.
- Parameters:
reason
- the reason for the exception- Throws:
CardRuntimeException
- always
-
-