org.apache.struts.util
Class ErrorMessages
java.lang.Object
org.apache.struts.util.ErrorMessages
public class ErrorMessages
extends java.lang.Object
Utility class that is useful for accumulating error message keys in
action classes or validation methods. Use this class as follows:
- At the beginning of your action class or validation method,
instantiate an instance of this class in a local variable.
- Whenever you wish to add a new error message key, call the
addError()
method to add it.
- To return the String array of error message keys required by
other Struts components, call
getErrors()
.
Version:
- David Geary
private Vector | errors - The accumulated set of error message keys.
|
void | addError(String key) - Add an error message key to the accumulated set of errors.
|
String | getError(int index) - Return the error message key at the specified zero-relative index.
|
String[] | getErrors() - Return the set of error message keys we have accumulated.
|
int | getSize() - Return the number of error message keys we have accumulated so far.
|
errors
private Vector errors
The accumulated set of error message keys.
addError
public void addError(String key)
Add an error message key to the accumulated set of errors.
key
- The error message key to be added
getError
public String getError(int index)
Return the error message key at the specified zero-relative index.
index
- Zero-relative index of the error message key to return
getErrors
public String[] getErrors()
Return the set of error message keys we have accumulated.
getSize
public int getSize()
Return the number of error message keys we have accumulated so far.
Copyright B) 2000-2005 - Apache Software Foundation