|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.AbstractXmlObject
com.waveset.object.ResultError
public class ResultError
A class used to represent information about an error that happened during some operation, which needs to be stored in a WavesetResult object.
These will be found in ResultItem objects whose type is "error". There are two basic ways to build one of these:
Field Summary | |
---|---|
static java.lang.String |
ATT_THROWABLE
|
static java.lang.String |
code_id
|
static java.lang.String |
EL_STACK
|
static java.lang.String |
ELEMENT
Our XML element name. |
static java.lang.String |
ITEM_TYPE
The ResultItem type name for these. |
Constructor Summary | |
---|---|
ResultError()
Build an empty error object, which can be populated manually. |
|
ResultError(org.w3c.dom.Element e)
Build an error object by parsing its DOM representation. |
|
ResultError(com.waveset.msgcat.Message msg)
Build an error object that captures a single Message object. |
|
ResultError(java.lang.Throwable t)
Build an error object that captures the state of a Throwable. |
Method Summary | |
---|---|
java.lang.String |
getElementName()
Return the XML element name, required by AbstractXmlObject. |
java.lang.String |
getFirstStackTrace()
Get the stack trace of the innermost nested error. |
java.lang.String |
getMessage()
Render the message hierarchy as a string in the current locale. |
java.lang.String |
getMessage(java.util.Locale locale)
Render the message hierarchy as a string. |
com.waveset.msgcat.Message[] |
getMessages()
Get the array of message objects. |
ResultError[] |
getNestedErrors()
Get the nested error objects, if this error was constructed from a list of wrapped exceptions. |
java.lang.String |
getStackTrace()
Get the stack trace found on the Throwable object from which this error object was built. |
java.lang.String |
getThrowableClass()
Get the name of the Throwable class from which this error object was built. |
void |
setMessages(com.waveset.msgcat.Message[] msgs)
Set the array of message objects. |
void |
setNestedErrors(ResultError[] e)
Set the nested error objects. |
void |
setStackTrace(java.lang.String s)
Get the stack trace found on the Throwable object from which this error object was built. |
void |
setThrowableClass(java.lang.String name)
Set the name of the Throwable class from which this error object was built. |
java.lang.String |
toString()
|
void |
toXml(java.lang.StringBuffer b,
int indent)
Serialize into a buffer with optional indentation. |
Methods inherited from class com.waveset.util.AbstractXmlObject |
---|
addXmlHeader, cloneObject, dump, dumpFile, getReference, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String ATT_THROWABLE
public static final java.lang.String code_id
public static final java.lang.String EL_STACK
public static final java.lang.String ELEMENT
public static final java.lang.String ITEM_TYPE
Constructor Detail |
---|
public ResultError()
public ResultError(org.w3c.dom.Element e) throws com.waveset.util.WavesetException
com.waveset.util.WavesetException
public ResultError(com.waveset.msgcat.Message msg)
public ResultError(java.lang.Throwable t)
Method Detail |
---|
public java.lang.String getElementName()
getElementName
in interface XmlObject
getElementName
in class AbstractXmlObject
public java.lang.String getFirstStackTrace()
If there is more than one wrapped exception, we follow the leftmost path.
public java.lang.String getMessage()
public java.lang.String getMessage(java.util.Locale locale)
public com.waveset.msgcat.Message[] getMessages()
public ResultError[] getNestedErrors()
public java.lang.String getStackTrace()
public java.lang.String getThrowableClass()
We return the name of the class rather than a Class object, since the code examining the ResultError is not necessarily in a context that is able to instantiate the throwable class.
public void setMessages(com.waveset.msgcat.Message[] msgs)
public void setNestedErrors(ResultError[] e)
public void setStackTrace(java.lang.String s)
public void setThrowableClass(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
public void toXml(java.lang.StringBuffer b, int indent)
AbstractXmlObject
toXml
in interface XmlObject
toXml
in class AbstractXmlObject
b
- StringBuffer in which to write the generated xmlindent
- Number of spaces to indent the generated xml block
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |