|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
org.apache.commons.lang.exception.NestableException
org.apache.cocoon.util.location.LocatedException
public class LocatedException
A cascading and located Exception. It is also MultiLocatable to easily build
stack traces.
| Field Summary |
|---|
| Fields inherited from class org.apache.commons.lang.exception.NestableException |
|---|
delegate |
| Constructor Summary | |
|---|---|
LocatedException(String message)
|
|
LocatedException(String message,
Location location)
|
|
LocatedException(String message,
Throwable cause)
|
|
LocatedException(String message,
Throwable cause,
Location location)
|
|
| Method Summary | |
|---|---|
static void |
addCauseLocations(MultiLocatable self,
Throwable cause)
Add to the location stack all locations of an exception chain. |
void |
addLocation(Location loc)
Add a location to the current list of locations. |
static void |
ensureCauseChainIsSet(Throwable thr)
Crawl the cause chain and ensure causes are properly set using "initCause" on JDK >= 1.4. |
Location |
getLocation()
Get the location of this object |
List |
getLocations()
Return the list of locations. |
String |
getMessage()
|
static String |
getMessage(String message,
List locations)
Standard way of building the message of a LocatableException, as a Java-like
stack trace of locations. |
String |
getRawMessage()
Get the raw message of the exception (the one used in the constructor) |
| Methods inherited from class org.apache.commons.lang.exception.NestableException |
|---|
getCause, getMessage, getMessages, getThrowable, getThrowableCount, getThrowables, indexOfThrowable, indexOfThrowable, printPartialStackTrace, printStackTrace, printStackTrace, printStackTrace |
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public LocatedException(String message)
public LocatedException(String message,
Throwable cause)
public LocatedException(String message,
Location location)
public LocatedException(String message,
Throwable cause,
Location location)
| Method Detail |
|---|
public static void ensureCauseChainIsSet(Throwable thr)
public static void addCauseLocations(MultiLocatable self,
Throwable cause)
Traversal of the call chain stops at the first Locatable exception which is supposed
to handle the loction of its causes by itself.
This method is static as a convenience for other implementations
of locatable exceptions.
self - the current locatable exceptioncause - a cause of selfpublic Location getLocation()
Locatable
getLocation in interface Locatablepublic List getLocations()
MultiLocatable
getLocations in interface MultiLocatablepublic String getRawMessage()
LocatableException
getRawMessage in interface LocatableException
public static String getMessage(String message,
List locations)
LocatableException, as a Java-like
stack trace of locations.
message - the exception's message, given by super.getMessage() (can be null)locations - the location list (can be null)
null no message and locations were given.public String getMessage()
getMessage in interface org.apache.commons.lang.exception.NestablegetMessage in class org.apache.commons.lang.exception.NestableExceptionpublic void addLocation(Location loc)
MultiLocatable
Implementations are free to filter locations that can be added (e.g. Location.UNKNOWN),
and there is therefore no guarantee that the given location will actually be added to the list.
Filtered locations are silently ignored.
addLocation in interface MultiLocatableloc - the location to be added.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||