org.opennfc
Class NfcException

Object
  extended by Throwable
      extended by Exception
          extended by org.opennfc.NfcException
All Implemented Interfaces:
Serializable

public final class NfcException
extends Exception

This NfcException is thrown when an error is detected in the NFC API.

Since:
Open NFC 4.0
See Also:
Serialized Form

Constructor Summary
NfcException(NfcErrorCode code)
          Creates a new NFC exception.
NfcException(String message, NfcErrorCode code)
          Creates a new NFC exception.
 
Method Summary
 NfcErrorCode getCode()
          Returns the code of the error causing the exception.
 String getMessage()
          Returns the message of the exception.
 String toString()
          Returns the string value of the exception.
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NfcException

public NfcException(String message,
                    NfcErrorCode code)
Creates a new NFC exception.

Parameters:
message - the exception message.
code - the code of the error causing the exception.

NfcException

public NfcException(NfcErrorCode code)
Creates a new NFC exception.

Parameters:
code - the code of the error causing the exception.
Method Detail

getCode

public NfcErrorCode getCode()
Returns the code of the error causing the exception.

Returns:
the error code.

toString

public String toString()
Returns the string value of the exception.

Overrides:
toString in class Throwable
Returns:
the string representing the exception.

getMessage

public String getMessage()
Returns the message of the exception.

Overrides:
getMessage in class Throwable
Returns:
the message of the exception, null if there is no message.

Copyright © 2010-2011 Inside Secure
Except as noted, this content is licensed under Apache 2.0 License.