Package org.springframework.web.bind
Class EscapedErrors
java.lang.Object
org.springframework.web.bind.EscapedErrors
- All Implemented Interfaces:
org.springframework.validation.Errors
Errors wrapper that adds automatic HTML escaping to the wrapped instance,
for convenient usage in HTML views. Can be retrieved easily via
RequestContext's
getErrors method.
Note that BindTag does not use this class to avoid unnecessary creation of ObjectError instances. It just escapes the messages and values that get copied into the respective BindStatus instance.
- Since:
- 01.03.2003
- Author:
- Juergen Hoeller
- See Also:
-
org.springframework.web.servlet.support.RequestContext#getErrorsorg.springframework.web.servlet.tags.BindTag
-
Field Summary
Fields inherited from interface org.springframework.validation.Errors
NESTED_PATH_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionEscapedErrors(org.springframework.validation.Errors source) Create a new EscapedErrors instance for the given source instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAllErrors(org.springframework.validation.Errors errors) List<org.springframework.validation.ObjectError>intorg.springframework.validation.FieldErrororg.springframework.validation.FieldErrorgetFieldError(String field) intintgetFieldErrorCount(String field) List<org.springframework.validation.FieldError>List<org.springframework.validation.FieldError>getFieldErrors(String field) Class<?>getFieldType(String field) getFieldValue(String field) org.springframework.validation.ObjectErrorintList<org.springframework.validation.ObjectError>org.springframework.validation.ErrorsbooleanbooleanbooleanhasFieldErrors(String field) booleanvoidvoidpushNestedPath(String subPath) voidvoidvoidvoidrejectValue(String field, String errorCode) voidrejectValue(String field, String errorCode, Object[] errorArgs, String defaultMessage) voidrejectValue(String field, String errorCode, String defaultMessage) voidsetNestedPath(String nestedPath) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.validation.Errors
failOnError, toString
-
Constructor Details
-
EscapedErrors
public EscapedErrors(org.springframework.validation.Errors source) Create a new EscapedErrors instance for the given source instance.
-
-
Method Details
-
getSource
public org.springframework.validation.Errors getSource() -
getObjectName
- Specified by:
getObjectNamein interfaceorg.springframework.validation.Errors
-
setNestedPath
- Specified by:
setNestedPathin interfaceorg.springframework.validation.Errors
-
getNestedPath
- Specified by:
getNestedPathin interfaceorg.springframework.validation.Errors
-
pushNestedPath
- Specified by:
pushNestedPathin interfaceorg.springframework.validation.Errors
-
popNestedPath
- Specified by:
popNestedPathin interfaceorg.springframework.validation.Errors- Throws:
IllegalStateException
-
reject
- Specified by:
rejectin interfaceorg.springframework.validation.Errors
-
reject
- Specified by:
rejectin interfaceorg.springframework.validation.Errors
-
reject
- Specified by:
rejectin interfaceorg.springframework.validation.Errors
-
rejectValue
- Specified by:
rejectValuein interfaceorg.springframework.validation.Errors
-
rejectValue
- Specified by:
rejectValuein interfaceorg.springframework.validation.Errors
-
rejectValue
public void rejectValue(@Nullable String field, String errorCode, @Nullable Object[] errorArgs, @Nullable String defaultMessage) - Specified by:
rejectValuein interfaceorg.springframework.validation.Errors
-
addAllErrors
public void addAllErrors(org.springframework.validation.Errors errors) - Specified by:
addAllErrorsin interfaceorg.springframework.validation.Errors
-
hasErrors
public boolean hasErrors()- Specified by:
hasErrorsin interfaceorg.springframework.validation.Errors
-
getErrorCount
public int getErrorCount()- Specified by:
getErrorCountin interfaceorg.springframework.validation.Errors
-
getAllErrors
- Specified by:
getAllErrorsin interfaceorg.springframework.validation.Errors
-
hasGlobalErrors
public boolean hasGlobalErrors()- Specified by:
hasGlobalErrorsin interfaceorg.springframework.validation.Errors
-
getGlobalErrorCount
public int getGlobalErrorCount()- Specified by:
getGlobalErrorCountin interfaceorg.springframework.validation.Errors
-
getGlobalErrors
- Specified by:
getGlobalErrorsin interfaceorg.springframework.validation.Errors
-
getGlobalError
@Nullable public org.springframework.validation.ObjectError getGlobalError()- Specified by:
getGlobalErrorin interfaceorg.springframework.validation.Errors
-
hasFieldErrors
public boolean hasFieldErrors()- Specified by:
hasFieldErrorsin interfaceorg.springframework.validation.Errors
-
getFieldErrorCount
public int getFieldErrorCount()- Specified by:
getFieldErrorCountin interfaceorg.springframework.validation.Errors
-
getFieldErrors
- Specified by:
getFieldErrorsin interfaceorg.springframework.validation.Errors
-
getFieldError
@Nullable public org.springframework.validation.FieldError getFieldError()- Specified by:
getFieldErrorin interfaceorg.springframework.validation.Errors
-
hasFieldErrors
- Specified by:
hasFieldErrorsin interfaceorg.springframework.validation.Errors
-
getFieldErrorCount
- Specified by:
getFieldErrorCountin interfaceorg.springframework.validation.Errors
-
getFieldErrors
- Specified by:
getFieldErrorsin interfaceorg.springframework.validation.Errors
-
getFieldError
- Specified by:
getFieldErrorin interfaceorg.springframework.validation.Errors
-
getFieldValue
- Specified by:
getFieldValuein interfaceorg.springframework.validation.Errors
-
getFieldType
- Specified by:
getFieldTypein interfaceorg.springframework.validation.Errors
-