org.kuali.rice.kns.util
Class ErrorContainer
java.lang.Object
org.kuali.rice.kns.util.ErrorContainer
- All Implemented Interfaces:
- Serializable
public class ErrorContainer
- extends Object
- implements Serializable
Provides access to a copy of an ErrorMap and information derived from it. Necessary because ErrorMap implements the Map
interface, which for some reason makes JSTL unwilling to translate ErrorMap.errorCount into a call to the getErrorCount method of
that ErrorMap instance.
Since I had to create this class to provide easy access to the error count (which must be computed as the sum of the sizes of the
error message lists of all properties in the ErrorMap), I also moved in the existing code which massaged the contents of the
ErrorMap for the purposes of export to the JSP.
- See Also:
- Serialized Form
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
errorMap
private final MessageMap errorMap
errorCount
private final int errorCount
ErrorContainer
public ErrorContainer(MessageMap errorMap)
- Constructs an ErrorContainer
- Parameters:
errorMap
-
getErrorCount
public int getErrorCount()
- Returns:
- number of errors in the ErrorMap used to initialize this container
getErrorPropertyList
public List getErrorPropertyList()
- Returns:
- simple List of all properies for which errorMessages exist in the ErrorMap used to initialize this container
hasFormatterError
private boolean hasFormatterError()
- This method checks whether the errorMap contains at least a formatter error.
- Returns:
- boolean true if the errorMap contains a formatter error and false otherwise
getRequestErrors
public org.apache.struts.action.ActionMessages getRequestErrors()
- Returns:
- ActionMessages instance containing error messages constructed from the contents of the ErrorMap with which this
container was initialized
Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.