| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--java.lang.Throwable
|
+--java.lang.Exception
|
+--org.springframework.validation.BindException
Default implementation of the Errors interface, supporting registration and evaluation of binding errors. Slightly unusual, as it is an exception.
This is mainly a framework-internal class. Normally, application
code will work with the Errors interface, or a DataBinder that in
turn exposes a BindException via getErrors().
Supports exporting a model, suitable for example for web MVC. Thus, it is sometimes used as parameter type instead of the Errors interface itself - if extracting the model makes sense in the respective context.
| Field Summary | |
final static String | ERROR_KEY_PREFIXPrefix for the name of the Errors instance in a model, followed by the object name. |
| Constructor Summary | |
BindException(Object target, String name)Create a new BindException instance. | |
| Method Summary | |
List | getAllErrors() |
PropertyEditor | getCustomEditor(String field) |
int | getErrorCount() |
FieldError | getFieldError(String field) |
int | getFieldErrorCount(String field) |
List | getFieldErrors(String field) |
Object | getFieldValue(String field) |
ObjectError | getGlobalError() |
int | getGlobalErrorCount() |
List | getGlobalErrors() |
String | getMessage()Returns diagnostic information about the errors held in this object. |
final Map | getModel()Return a model Map for the obtained state, exposing an Errors instance as 'ERROR_KEY_PREFIX + objectName' and the object itself. |
String | getObjectName() |
Object | getTarget()Return the wrapped target object. |
boolean | hasErrors() |
boolean | hasFieldErrors(String field) |
boolean | hasGlobalErrors() |
void | reject(String errorCode, String defaultMessage) |
void | reject(String errorCode, Object[] errorArgs, String defaultMessage) |
void | rejectValue(String field, String errorCode, String defaultMessage) |
void | rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) |
void | setNestedPath(String nestedPath) |
| Methods inherited from class java.lang.Throwable |
printStackTrace, printStackTrace, printStackTrace, getStackTrace, setStackTrace, getLocalizedMessage, toString, fillInStackTrace, getCause, initCause |
| Methods inherited from class java.lang.Object |
hashCode, notify, notifyAll, wait, wait, wait, getClass, equals |
| Field Detail |
public final static String ERROR_KEY_PREFIX
| Constructor Detail |
public BindException(Object target, String name)
| Method Detail |
public List getAllErrors()
public PropertyEditor getCustomEditor(String field)
public int getErrorCount()
public FieldError getFieldError(String field)
public int getFieldErrorCount(String field)
public List getFieldErrors(String field)
public Object getFieldValue(String field)
public ObjectError getGlobalError()
public int getGlobalErrorCount()
public List getGlobalErrors()
public String getMessage()
public final Map getModel()
Note that the Map is constructed each time you're calling this method, adding things to the map and then re-calling it will not do...
public String getObjectName()
public Object getTarget()
public boolean hasErrors()
public boolean hasFieldErrors(String field)
public boolean hasGlobalErrors()
public void reject(String errorCode, String defaultMessage)
public void reject(String errorCode, Object[] errorArgs, String defaultMessage)
public void rejectValue(String field, String errorCode, String defaultMessage)
public void rejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage)
public void setNestedPath(String nestedPath)
| Association Links |
to Class java.util.List
to Class org.springframework.beans.BeanWrapper
to Class java.lang.String
to Class java.lang.String
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||