Class CardException

  • All Implemented Interfaces:
    java.io.Serializable
    Direct Known Subclasses:
    CardExceptionSubclass, UserException

    public class CardException
    extends java.lang.Exception
    The CardException class defines a field reason and two accessor methods getReason() and setReason(). The reason field encapsulates exception cause identifier in the Java Card API. All Java Card API checked Exception classes should extend CardException.
    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 code
      void setReason​(short reason)
      Set reason code.
      static void throwIt​(short reason)
      Throw an instance of CardException class with the specified reason.
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • CardException

        public CardException​(short reason)
        Construct a CardException instance with the specified reason.
        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 CardException
        Throw an instance of CardException class with the specified reason.
        Parameters:
        reason - the reason for the exception
        Throws:
        CardException - always.