org.apache.beehive.netui.tags
Interface IErrorReporter

All Known Implementing Classes:
Html, Template

public interface IErrorReporter

An ErrorReporter acts as a container allowing a tag to gather up all errors reported by it's children and report them as a single group. Typically, there should be a single active ErrorReporter so all the errors on the page are reported in a single place. All error reporters must look at any parent tags and also the CONTAINER_ERRORS request variable for an instance of ErrorReporter before becoming the primary ErrorReporter. If another ErrorReporter is defined, the tag should return false from the isReporting() method. Otherwise, the tag may become the primary ErrorReporter. If a tag sets the CONTAINER_ERRORS request attribute, it must clear this when processing it's doEndTag() method because it will not be able to report errors after this point.


Field Summary
static String CONTAINER_ERRORS
          This is a request scoped attribute name which may contain an ErrorReporter instance.
 
Method Summary
 void addError(AbstractPageError ape)
          Add an error to this ErrorReporter.
 boolean isReporting()
          This boolean indicates if an ErrorReporter is reporting errors or not.
 ArrayList returnErrors()
          Return an ArrayList of the errors
 

Field Detail

CONTAINER_ERRORS

static final String CONTAINER_ERRORS
This is a request scoped attribute name which may contain an ErrorReporter instance. If this is defined, then this is the top most error reporter and should be used to report errors.

See Also:
Constant Field Values
Method Detail

addError

void addError(AbstractPageError ape)
Add an error to this ErrorReporter.

Parameters:
ape - the page error to add to the container.

isReporting

boolean isReporting()
This boolean indicates if an ErrorReporter is reporting errors or not. The caller should check this before calling addError because the ErrorReporter may be off.

Returns:
a boolean indicating if the tag is reporting errors or not.

returnErrors

ArrayList returnErrors()
Return an ArrayList of the errors

Returns:
an ArrayList of all errors.