Package javacard.framework
Class CardException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- javacard.framework.CardException
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
CardExceptionSubclass
,UserException
public class CardException extends java.lang.Exception
TheCardException
class defines a fieldreason
and two accessor methodsgetReason()
andsetReason()
. Thereason
field encapsulates exception cause identifier in the Java Card API. All Java Card API checked Exception classes should extendCardException
.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description CardException(short reason)
Construct a CardException instance with the specified reason.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description short
getReason()
Get reason codevoid
setReason(short reason)
Set reason code.static void
throwIt(short reason)
Throw an instance ofCardException
class with the specified reason.
-
-
-
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 CardException
Throw an instance ofCardException
class with the specified reason.- Parameters:
reason
- the reason for the exception- Throws:
CardException
- always.
-
-