org.w3c.ddr.simple.exception
Class DDRException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by org.w3c.ddr.simple.exception.DDRException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
InitializationException, NameException, ValueException

public class DDRException
extends java.lang.Exception

Represents a DDR Exception.

Author:
Jo Rabin (dotMobi),
Jose Manuel Cantera Fonseca (Telefonica I+D),
Rotan Hanrahan (MobileAware),
Ignacio Marin (Fundacion CTIC)
Copyright © 2008 W3C® (MIT, ERCIM, Keio), All Rights Reserved.
W3C liability, trademark and document use rules apply.
See Also:
Serialized Form

Field Summary
protected  int code
          An exception code, which represents the nature/cause of the exception.
static int IMPLEMENTATION_ERROR
          Implementation specific error codes must be greater than this
 
Constructor Summary
DDRException()
          Constructs a DDRException instance with an undefined exception code.
DDRException(int code, java.lang.String message)
          Constructs a DDRException instance with a code and human-readable message.
DDRException(int code, java.lang.Throwable thr)
          Constructs a DDRException instance with a code and Throwable object that may indicate further details of the cause of the exception.
 
Method Summary
 int getCode()
          Retrieves the exception code, which determines the nature/cause of the exception.
 java.lang.String getMessage()
          Retrieves a human-readable diagnostic message, intended for error messages.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, 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

IMPLEMENTATION_ERROR

public static int IMPLEMENTATION_ERROR
Implementation specific error codes must be greater than this


code

protected int code
An exception code, which represents the nature/cause of the exception.

Constructor Detail

DDRException

public DDRException()
Constructs a DDRException instance with an undefined exception code.


DDRException

public DDRException(int code,
                    java.lang.String message)
Constructs a DDRException instance with a code and human-readable message.

Parameters:
code - This should be a constant from this exception class.
message - Diagnostic message intended for human reading.

DDRException

public DDRException(int code,
                    java.lang.Throwable thr)
Constructs a DDRException instance with a code and Throwable object that may indicate further details of the cause of the exception.

Parameters:
code - This should be a constant from this exception class.
thr - A Throwable object that may contain further details on the exception.
Method Detail

getCode

public int getCode()
Retrieves the exception code, which determines the nature/cause of the exception.

Returns:
Explanatory code.

getMessage

public java.lang.String getMessage()
Retrieves a human-readable diagnostic message, intended for error messages.

Overrides:
getMessage in class java.lang.Throwable
Returns:
Human-readable diagnostic message.