TagLib documentation

org.alweb.doff.util.error
Class ErrorContainer

java.lang.Object
  extended by org.alweb.doff.util.error.ErrorContainer
All Implemented Interfaces:
ErrorProducer
Direct Known Subclasses:
Service

public class ErrorContainer
extends Object
implements ErrorProducer

Implements of interface ErrorProducer. You can extend this class for raising errors.

Since:
1.4
Author:
Alexis Toulotte

Constructor Summary
ErrorContainer()
           
 
Method Summary
protected  ErrorMessage addError(ErrorMessage error)
          Adds specified error (if not null) to internal error list.
protected  ErrorMessage addError(String message, Object... params)
          Creates and add an error from specified message and params and return it.
protected  void addErrors(Collection<ErrorMessage> errors)
          Adds all errors from the specified collection to the error internal collection.
protected  void addErrors(ErrorProducer... producers)
          Adds all errors of specified producers to errors internal collection.
protected  void addErrors(String... messages)
          Adds and construct all errors from specified messages.
protected  void clearErrors()
          Clear all errors of this object.
 Collection<ErrorMessage> getErrors()
          Returns a collection of this object errors.
 boolean isInErrorState()
          Determines if this object is in error state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ErrorContainer

public ErrorContainer()
Method Detail

addError

protected ErrorMessage addError(ErrorMessage error)
Adds specified error (if not null) to internal error list.

Returns:
The error parameter for chaining.
See Also:
getErrors()

addError

protected ErrorMessage addError(String message,
                                Object... params)
Creates and add an error from specified message and params and return it.

See Also:
getErrors(), ErrorMessage.ErrorMessage(String, Object[])

addErrors

protected void addErrors(Collection<ErrorMessage> errors)
Adds all errors from the specified collection to the error internal collection. Only not null errors are added.

See Also:
addError(ErrorMessage)

addErrors

protected void addErrors(ErrorProducer... producers)
Adds all errors of specified producers to errors internal collection.

See Also:
addErrors(Collection)

addErrors

protected void addErrors(String... messages)
Adds and construct all errors from specified messages. Created errors will not contain any parameter.

See Also:
addError(String, Object[])

clearErrors

protected void clearErrors()
Clear all errors of this object.

See Also:
getErrors(), Collection.clear()

getErrors

public Collection<ErrorMessage> getErrors()
Returns a collection of this object errors. This method can be overrided in order to retrieve errors from another container (a HttpServletRequest for example. This method must never return null.

Specified by:
getErrors in interface ErrorProducer

isInErrorState

public boolean isInErrorState()
Determines if this object is in error state. In other words if it contains at least one error.


TagLib documentation