Version 4.10.0

hirondelle.web4j.model
Class AppException

Object
  extended by Throwable
      extended by Exception
          extended by hirondelle.web4j.model.AppException
All Implemented Interfaces:
MessageList, Serializable
Direct Known Subclasses:
DAOException, ModelCtorException

public class AppException
extends Exception
implements MessageList

Base class for most exceptions defined by WEB4J.

Differs from most exception classes in that multiple error messages may be used, instead of just one. Used in JSPs to inform the user of error conditions, usually related to user input validations.

This class is Serializable, since all Throwables are serializable.

See Also:
Serialized Form

Constructor Summary
AppException()
          No-argument constructor.
AppException(String aMessage, Throwable aThrowable)
          Constructor.
 
Method Summary
 void add(AppException ex)
          Add all AppResponseMessages attached to aAppEx to this list.
 void add(String aErrorMessage)
          Add a simple AppResponseMessage to this list.
 void add(String aErrorMessage, Object... aParams)
          Add a compound AppResponseMessage to this list.
 List<AppResponseMessage> getMessages()
          Return an unmodifiable List of AppResponseMessages.
 boolean isEmpty()
          Return true only if there are no messages in this list.
 boolean isNotEmpty()
          Return the negation of MessageList.isEmpty().
 String toString()
          Intended for debugging only.
 
Methods inherited from class Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AppException

public AppException()
No-argument constructor.


AppException

public AppException(String aMessage,
                    Throwable aThrowable)
Constructor.

Parameters:
aMessage - text describing the problem. Must have content.
aThrowable - root cause underlying the problem.
Method Detail

add

public final void add(String aErrorMessage)
Description copied from interface: MessageList
Add a simple AppResponseMessage to this list.

The argument satisfies the same conditions as AppResponseMessage.forSimple(java.lang.String).

Specified by:
add in interface MessageList

add

public final void add(String aErrorMessage,
                      Object... aParams)
Description copied from interface: MessageList
Add a compound AppResponseMessage to this list.

The arguments satisfy the same conditions as AppResponseMessage.forCompound(java.lang.String, java.lang.Object...).

Specified by:
add in interface MessageList

add

public final void add(AppException ex)
Description copied from interface: MessageList
Add all AppResponseMessages attached to aAppEx to this list.

Specified by:
add in interface MessageList

isEmpty

public boolean isEmpty()
Description copied from interface: MessageList
Return true only if there are no messages in this list.

Note that this method name conflicts with the empty keyword of JSTL. Thus, MessageList.isNotEmpty() is supplied as an alternative.

Specified by:
isEmpty in interface MessageList

isNotEmpty

public final boolean isNotEmpty()
Description copied from interface: MessageList
Return the negation of MessageList.isEmpty().

Specified by:
isNotEmpty in interface MessageList

getMessages

public final List<AppResponseMessage> getMessages()
Description copied from interface: MessageList
Return an unmodifiable List of AppResponseMessages.

Specified by:
getMessages in interface MessageList

toString

public String toString()
Intended for debugging only.

Overrides:
toString in class Throwable

Version 4.10.0

Copyright Hirondelle Systems. Published October 19, 2013 - User Guide - All Docs.