Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

oracle.adfmf.framework.exception
Class AdfException

Object
  extended by Throwable
      extended by Exception
          extended by RuntimeException
              extended by oracle.adfmf.framework.exception.AdfException
All Implemented Interfaces:
java.io.Serializable, JSONSerializable
Direct Known Subclasses:
AdfInvocationRuntimeException

public class AdfException
extends RuntimeException
implements JSONSerializable

Exception class used by ADFMF to generate and use exceptions in the framework. It implements JSONSerializable as we want only selected bits to be serialized and thus this class implements toJSON() which handles serialization of this class.

See Also:
Serialized Form

Field Summary
static String ERROR
          AdfException severity constant for ERROR logging
static String FATAL
          AdfException severity constant for FATAL logging
static String INFO
          AdfException severity constant for INFO logging
static String WARNING
          AdfException severity constant for WARNING logging
 
Constructor Summary
AdfException()
          Default no argument AdfException constructor
AdfException(String message, String severity)
          AdfException constructor
AdfException(String severity, String bundleName, String key, Object[] params)
          AdfException constructor
AdfException(Throwable t)
          AdfException constructor
AdfException(Throwable t, String severity)
          AdfException constructor
 
Method Summary
 String getMessage()
          Get error message from the exception object
 String getSeverity()
          Get severity of the exception
 String getType()
          Get type of exception
 boolean isException()
          Check if its an exception
 void setException(boolean exception)
          Set exception flag
 void setMessage(String message)
          Set the error message to the exception object
 void setSeverity(String sev)
          Set severity of the exception
 void setType(String type)
          Set type of exception
 Object toJSON()
          toJSON implementation as AdfException class implements JSONSerializable
 String toString()
          Method to convert AdfException object to String.
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INFO

public static final String INFO
AdfException severity constant for INFO logging

See Also:
Constant Field Values

WARNING

public static final String WARNING
AdfException severity constant for WARNING logging

See Also:
Constant Field Values

ERROR

public static final String ERROR
AdfException severity constant for ERROR logging

See Also:
Constant Field Values

FATAL

public static final String FATAL
AdfException severity constant for FATAL logging

See Also:
Constant Field Values
Constructor Detail

AdfException

public AdfException()
Default no argument AdfException constructor


AdfException

public AdfException(String severity,
                    String bundleName,
                    String key,
                    Object[] params)
AdfException constructor

Parameters:
severity - Severity of the exception (Use AdfException Severity constants - INFO, WARNING, ERROR)
bundleName - Name of the bundle where the message key belongs
key - Message key in the bundle
params - Additional parameters to be used in constructing the error message

AdfException

public AdfException(String message,
                    String severity)
AdfException constructor

Parameters:
message - Error Message string
severity - Severity of the exception (Use AdfException Severity constants - INFO, WARNING, ERROR)

AdfException

public AdfException(Throwable t)
AdfException constructor

Parameters:
t - Throwable object to be used to generate AdfException object

AdfException

public AdfException(Throwable t,
                    String severity)
AdfException constructor

Parameters:
t - Throwable to be used to generate AdfException object
severity - Severity of the exception (Use AdfException Severity constants - INFO, WARNING, ERROR)
Method Detail

getMessage

public String getMessage()
Get error message from the exception object

Overrides:
getMessage in class Throwable
Returns:
Error Message as a String

setMessage

public void setMessage(String message)
Set the error message to the exception object

Parameters:
message - Error message as a String

getSeverity

public String getSeverity()
Get severity of the exception

Returns:
Severity of the exception (INFO, WARNING, ERROR, FATAL)

setSeverity

public void setSeverity(String sev)
Set severity of the exception

Parameters:
sev - Severity of the exception (INFO, WARNING, ERROR, FATAL)

getType

public String getType()
Get type of exception

Returns:
Exception type class name - exceptionClassName.class.getName())

setType

public void setType(String type)
Set type of exception

Parameters:
type - Type of exception (Exception class name - exceptionClassName.class.getName())

isException

public boolean isException()
Check if its an exception

Returns:
boolean returning true if it's an exception, false otherwise

setException

public void setException(boolean exception)
Set exception flag

Parameters:
exception - boolean flag set to indicate if it's an exception or not.

toString

public String toString()
Method to convert AdfException object to String.

Overrides:
toString in class Throwable

toJSON

public Object toJSON()
              throws Exception
toJSON implementation as AdfException class implements JSONSerializable

Specified by:
toJSON in interface JSONSerializable
Returns:
Object
Throws:
Exception

Oracle Fusion Middleware Java API Reference for Oracle Mobile Application Framework
2.0.0.0.0

E36392-01

Copyright © 2014 Oracle. All Rights Reserved.