org.apache.beehive.netui.tags
Class ErrorHandling

Object
  extended by ErrorHandling

public class ErrorHandling
extends Object


Constructor Summary
ErrorHandling()
           
 
Method Summary
 String getErrorsReport(String tagName)
          This method will return a String that represents all of the errors that were registered for the tag.
 String getInlineError(String tagName)
           
 boolean hasErrors()
          This method will return true if there have been any errors registered on this tag.
 void registerTagError(AbstractPageError error, JspTag tag)
          This method will add an error to the errors begin tracked by the tag.
 void registerTagError(String message, String tagName, JspTag tag, Throwable e)
          This will report an error from a tag.
static void reportCollectedErrors(InternalStringBuilder sb, JspTag tag)
          This method get the current errors and write the formated output
static void reportCollectedErrors(PageContext pc, JspTag tag)
          This method get the current errors and write the formated output
 void reportErrors(Writer writer, String tagName)
          This method will write out the String returned by getErrorsReport to the response output stream.
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorHandling

public ErrorHandling()
Method Detail

registerTagError

public void registerTagError(String message,
                             String tagName,
                             JspTag tag,
                             Throwable e)
                      throws JspException
This will report an error from a tag. The error will contain a message. If error reporting is turned off, the message will be returned and the caller should throw a JspException to report the error.

Parameters:
message - - the message to register with the error
Throws:
JspException - - if in-page error reporting is turned off this method will always throw a JspException.

registerTagError

public void registerTagError(AbstractPageError error,
                             JspTag tag)
                      throws JspException
This method will add an error to the errors begin tracked by the tag. After the first time this method is called, hasErrors will return true.

Parameters:
error - The EvalErrorInfo describing the error.
Throws:
JspException

hasErrors

public boolean hasErrors()
This method will return true if there have been any errors registered on this tag. Otherwise it returns false

Returns:
true if errors have been reported on this tag.
See Also:
registerTagError(java.lang.String, java.lang.String, javax.servlet.jsp.tagext.JspTag, java.lang.Throwable)

reportErrors

public void reportErrors(Writer writer,
                         String tagName)
                  throws JspException
This method will write out the String returned by getErrorsReport to the response output stream.

Throws:
JspException - if write throws an exception.
See Also:
getErrorsReport(java.lang.String)

getInlineError

public String getInlineError(String tagName)

getErrorsReport

public String getErrorsReport(String tagName)
This method will return a String that represents all of the errors that were registered for the tag. This method assumes that there are errors in the tag and asserts this is true. Code will typically call hasErrors before calling this method.

Returns:
A String that contains all of the errors registered on this tag.
See Also:
registerTagError(java.lang.String, java.lang.String, javax.servlet.jsp.tagext.JspTag, java.lang.Throwable)

reportCollectedErrors

public static void reportCollectedErrors(InternalStringBuilder sb,
                                         JspTag tag)
This method get the current errors and write the formated output

Parameters:
sb -

reportCollectedErrors

public static void reportCollectedErrors(PageContext pc,
                                         JspTag tag)
This method get the current errors and write the formated output

Parameters:
pc -