|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.channels.error.error2xml.DelegatingThrowableToElement
public class DelegatingThrowableToElement
A wrapper for a List of child ThrowableToElements and the logic to poll them in order, accepting the result from the first to support the given throwable. Defaults to the standard List of ThrowableToElement implementations, but provides API hooks to change the list. You can add handling for other Throwables by either editing this implementation code to include additional ThrowableToElement implementations by default or by injecting a different List of ThrowableToElement implementations where the instance of this class that CError actually uses is configured in applicationContext.xml.
Field Summary | |
---|---|
private java.util.List |
throwableToElements
List of ThrowableToElement implementations in order from most specific to least specific. |
Constructor Summary | |
---|---|
DelegatingThrowableToElement()
Instantiate a DelegatingThrowableToElement with a default List of delegates. |
Method Summary | |
---|---|
java.util.List |
getThrowableToElements()
Get the List of ThrowableToElements delegates. |
void |
setThrowableToElements(java.util.List throwableToElements)
Set the List of ThrowableToElement implementations which this implementation will poll in order. |
boolean |
supports(java.lang.Class c)
Returns true if the implementation knows how to translate an instance of the given class into an Element (throwableToElement() will return non-null) for instances of the class, which must extend Throwable). |
org.w3c.dom.Element |
throwableToElement(java.lang.Throwable t,
org.w3c.dom.Document parentDoc)
Obtain an Element representing the throwable. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private java.util.List throwableToElements
Constructor Detail |
---|
public DelegatingThrowableToElement()
Method Detail |
---|
public java.util.List getThrowableToElements()
public void setThrowableToElements(java.util.List throwableToElements)
throwableToElements
- List of ThrowableToElement impls.public boolean supports(java.lang.Class c) throws java.lang.IllegalArgumentException
IThrowableToElement
supports
in interface IThrowableToElement
c
- a Class extending Throwable
java.lang.IllegalArgumentException
- if c is null or does not extend Throwablepublic org.w3c.dom.Element throwableToElement(java.lang.Throwable t, org.w3c.dom.Document parentDoc) throws java.lang.IllegalArgumentException
IThrowableToElement
throwableToElement
in interface IThrowableToElement
t
- a supported throwableparentDoc
- document into which the element is to go
java.lang.IllegalArgumentException
- if t is null.public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |