abstract class AbstractException
extends java.lang.RuntimeException
Modifier and Type | Field and Description |
---|---|
protected int |
errorContentLength |
private static long |
serialVersionUID |
Modifier | Constructor and Description |
---|---|
protected |
AbstractException(java.lang.String message,
java.lang.Throwable cause) |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.String |
getDetails()
Subclasses must implement this method to return as much information as possible about the internal state of the parser/writer.
|
protected abstract java.lang.String |
getErrorDescription()
Returns a generic description of the error.
|
java.lang.String |
getMessage()
Returns a detailed message describing the error, and the internal state of the parser/writer.
|
protected static java.lang.String |
printIfNotEmpty(java.lang.String previous,
java.lang.String description,
java.lang.Object o) |
protected java.lang.String |
restrictContent(java.lang.CharSequence content) |
static java.lang.String |
restrictContent(int errorContentLength,
java.lang.CharSequence content) |
static java.lang.Object[] |
restrictContent(int errorContentLength,
java.lang.Object[] content) |
protected java.lang.String |
restrictContent(java.lang.Object content) |
protected java.lang.Object[] |
restrictContent(java.lang.Object[] content) |
void |
setErrorContentLength(int errorContentLength) |
protected java.lang.String |
updateMessage(java.lang.String msg)
Allows subclasses to alter the exception message that should be displayed to end users.
|
private static final long serialVersionUID
protected int errorContentLength
protected AbstractException(java.lang.String message, java.lang.Throwable cause)
public final java.lang.String getMessage()
getMessage
in class java.lang.Throwable
protected java.lang.String updateMessage(java.lang.String msg)
msg
- the original messageprotected abstract java.lang.String getDetails()
printIfNotEmpty(String, String, Object)
to create a comma-separated list of relevant properties and their (non null) values.
The result of this method is used by the getMessage()
method to print out these details after the error message.protected abstract java.lang.String getErrorDescription()
getMessage()
to print out a general description of the error before a detailed message of the root cause.protected static java.lang.String printIfNotEmpty(java.lang.String previous, java.lang.String description, java.lang.Object o)
public static java.lang.String restrictContent(int errorContentLength, java.lang.CharSequence content)
public static java.lang.Object[] restrictContent(int errorContentLength, java.lang.Object[] content)
public void setErrorContentLength(int errorContentLength)
protected java.lang.String restrictContent(java.lang.CharSequence content)
protected java.lang.String restrictContent(java.lang.Object content)
protected java.lang.Object[] restrictContent(java.lang.Object[] content)