com.opensymphony.xwork2
Class XWorkException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by com.opensymphony.xwork2.XWorkException
All Implemented Interfaces:
Locatable, Serializable
Direct Known Subclasses:
ConfigurationException, ReferenceResolverException, ReflectionException, StrutsException, TypeConversionException

public class XWorkException
extends RuntimeException
implements Locatable

A generic runtime exception that optionally contains Location information

Author:
Jason Carreira
See Also:
Serialized Form

Field Summary
private  Location location
           
 
Constructor Summary
XWorkException()
          Constructs a XWorkException with no detail message.
XWorkException(String s)
          Constructs a XWorkException with the specified detail message.
XWorkException(String s, Object target)
          Constructs a XWorkException with the specified detail message and target.
XWorkException(String s, Throwable cause)
          Constructs a XWorkException with the specified detail message and exception cause.
XWorkException(String s, Throwable cause, Object target)
          Constructs a XWorkException with the specified detail message, cause, and target
XWorkException(Throwable cause)
          Constructs a XWorkException with the root cause
XWorkException(Throwable cause, Object target)
          Constructs a XWorkException with the root cause and target
 
Method Summary
 Location getLocation()
          Gets the location of the error, if available
 Throwable getThrowable()
          Deprecated. Use Throwable.getCause()
 String toString()
          Returns a short description of this throwable object, including the location.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

location

private Location location
Constructor Detail

XWorkException

public XWorkException()
Constructs a XWorkException with no detail message.


XWorkException

public XWorkException(String s)
Constructs a XWorkException with the specified detail message.

Parameters:
s - the detail message.

XWorkException

public XWorkException(String s,
                      Object target)
Constructs a XWorkException with the specified detail message and target.

Parameters:
s - the detail message.
target - the target of the exception.

XWorkException

public XWorkException(Throwable cause)
Constructs a XWorkException with the root cause

Parameters:
cause - The wrapped exception

XWorkException

public XWorkException(Throwable cause,
                      Object target)
Constructs a XWorkException with the root cause and target

Parameters:
cause - The wrapped exception
target - The target of the exception

XWorkException

public XWorkException(String s,
                      Throwable cause)
Constructs a XWorkException with the specified detail message and exception cause.

Parameters:
s - the detail message.
cause - the wrapped exception

XWorkException

public XWorkException(String s,
                      Throwable cause,
                      Object target)
Constructs a XWorkException with the specified detail message, cause, and target

Parameters:
s - the detail message.
cause - The wrapped exception
target - The target of the exception
Method Detail

getThrowable

public Throwable getThrowable()
Deprecated. Use Throwable.getCause()

Gets the underlying cause

Returns:
the underlying cause, null if no cause

getLocation

public Location getLocation()
Gets the location of the error, if available

Specified by:
getLocation in interface Locatable
Returns:
the location, null if not available

toString

public String toString()
Returns a short description of this throwable object, including the location. If no detailed message is available, it will use the message of the underlying exception if available.

Overrides:
toString in class Throwable
Returns:
a string representation of this Throwable.


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.