Nokia Extensions for JSR-257

com.nokia.nfc.nxp.mfstd
Class MFStandardException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by javax.microedition.contactless.ContactlessException
              extended by com.nokia.nfc.nxp.mfstd.MFStandardException
All Implemented Interfaces:
java.io.Serializable

public class MFStandardException
extends javax.microedition.contactless.ContactlessException

Thrown to indicate an error specific to the Mifare Standard Card communication, i.e. if authentication fails or if the methods conditions are not met.

See Also:
Serialized Form

Field Summary
static int ERROR_AUTH
          Indicates that an authentication error occurred.
static int ERROR_CONDITIONS
          Indicates that the methods conditions were not met.
static int ERROR_GENERIC
          Indicates a generic error.
static int ERROR_PROTECTED
          Indicates that the write operation failed because the data area is write protected.
 
Constructor Summary
MFStandardException(int reason)
          Constructs a new MFStandardException object.
MFStandardException(int reason, java.lang.String message)
          Constructs a new MFStandardException object.
 
Method Summary
 int getReason()
          Returns the reason for the communication error.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ERROR_GENERIC

public static final int ERROR_GENERIC
Indicates a generic error. Used when a more specific reason cannot be defined.

See Also:
Constant Field Values

ERROR_AUTH

public static final int ERROR_AUTH
Indicates that an authentication error occurred.

See Also:
Constant Field Values

ERROR_CONDITIONS

public static final int ERROR_CONDITIONS
Indicates that the methods conditions were not met.

See Also:
Constant Field Values

ERROR_PROTECTED

public static final int ERROR_PROTECTED
Indicates that the write operation failed because the data area is write protected. Used when trying to write to manufacturer block.

See Also:
Constant Field Values
Constructor Detail

MFStandardException

public MFStandardException(int reason)
Constructs a new MFStandardException object.

Parameters:
reason - the reason of the error.
Throws:
java.lang.IllegalArgumentException - if the reason value is not supported.

MFStandardException

public MFStandardException(int reason,
                           java.lang.String message)
Constructs a new MFStandardException object.

Parameters:
reason - the reason of the error.
message - optional message.
Throws:
java.lang.IllegalArgumentException - if the reason value is not supported.
Method Detail

getReason

public int getReason()
Returns the reason for the communication error. Possible reason codes are:

Returns:
the reason for the communication error.

Nokia Extensions for JSR-257

Copyright � 2010 Nokia Corporation. All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.