FileDocCategorySizeDatePackage
CardException.javaAPI DocphoneME MR2 API (J2ME)2458Wed May 02 18:00:40 BST 2007javacard.framework

CardException

public class CardException extends Exception
The CardException class defines a field reason and two accessor methods getReason() and setReason(). The reason field encapsulates an exception cause identifier in Java Card. All Java Card checked exception classes should extend CardException.

Fields Summary
private short
reason
Reason code for the detected error.
Constructors Summary
public CardException(short reason)
Constructs a CardException instance with the specified reason.

param
reason the reason for the exception

	setReason(reason);
    
Methods Summary
public shortgetReason()
Gets the reason code.

return
the reason for the exception
see
#setReason

	return reason;
    
public voidsetReason(short reason)
Sets the reason code.

param
reason the reason for the exception
see
#getReason

	this.reason = reason;
    
public static voidthrowIt(short reason)
Throws an instance of CardException class with the specified reason.

param
reason the reason for the exception
exception
CardException always

   
	throw new CardException(reason);