Obviously, object status representations (i.e. errors at the object level rather than the field level) do not have an expression and a value but only error codes and messages. For simplicity's sake and to be able to use the same tags and macros, the same status class is used for both scenarios.
RequestContext#getBindStatus, org.springframework.web.servlet.tags.BindTag , org.springframework.web.servlet.view.AbstractTemplateView#setExposeSpringMacroHelpers
| Modifier and Type | Field and Description |
|---|---|
| private Object | |
| private BindingResult | |
| private PropertyEditor | |
| private final String[] | |
| private String[] | |
| private final Errors | |
| private final String | |
| private final boolean | |
| private List | |
| private final String | |
| private final RequestContext | |
| private Object | |
| private Class |
| Access | Constructor and Description |
|---|---|
| public | BindStatus(RequestContext
the current RequestContext requestContext, String the bean and property path for which values and errors
will be resolved (e.g. "customer.address.street") path, boolean whether to HTML-escape error messages and string values htmlEscape)Create a new BindStatus instance, representing a field or object status. |
| Modifier and Type | Method and Description |
|---|---|
| public PropertyEditor | Returns: the associated PropertyEditor, ornull if nonethe value class that an editor is needed for valueClass)Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to. |
| public Object | getActualValue()
Return the actual value of the field, i.e. the raw property value,
or |
| public String | getDisplayValue()
Return a suitable display value for the field, i.e. the stringified value if not null, and an empty string in case of a null value. |
| public PropertyEditor | Returns: the current PropertyEditor, ornull if noneReturn the PropertyEditor for the property that this bind status is currently bound to. |
| public String | |
| public String[] | |
| public String | |
| public String[] | |
| public String | Returns: the error message stringseparator string, e.g. ", " or " delimiter)" Return an error message string, concatenating all messages separated by the given delimiter. |
| public Errors | Returns: the current Errors instance, ornull if noneReturn the Errors instance (typically a BindingResult) that this bind status is currently associated with. |
| public String | getExpression()
Return a bind expression that can be used in HTML forms as input name
for the respective field, or |
| public String | getPath()
Return the bean and property path for which values and errors will be resolved (e.g. "customer.address.street"). |
| public Object | getValue()
Return the current value of the field, i.e. either the property value
or a rejected update, or |
| public Class | |
| private static String[] | initErrorCodes(List<? extends ObjectError> objectErrors)
Extract the error codes from the ObjectError list. |
| private String[] | |
| public boolean | |
| public String |
| actualValue | back to summary |
|---|---|
| private Object actualValue
| |
| bindingResult | back to summary |
|---|---|
| private BindingResult bindingResult
| |
| editor | back to summary |
|---|---|
| private PropertyEditor editor
| |
| errorCodes | back to summary |
|---|---|
| private final String[] errorCodes | |
| errorMessages | back to summary |
|---|---|
| private String[] errorMessages
| |
| errors | back to summary |
|---|---|
| private final Errors errors
| |
| expression | back to summary |
|---|---|
| private final String expression
| |
| htmlEscape | back to summary |
|---|---|
| private final boolean htmlEscape | |
| objectErrors | back to summary |
|---|---|
| private List<? extends ObjectError> objectErrors
| |
| path | back to summary |
|---|---|
| private final String path | |
| requestContext | back to summary |
|---|---|
| private final RequestContext requestContext | |
| value | back to summary |
|---|---|
| private Object value
| |
| valueType | back to summary |
|---|---|
| private Class<?> valueType
| |
| BindStatus | back to summary |
|---|---|
| public BindStatus(RequestContext requestContext, String path, boolean htmlEscape) throws IllegalStateException Create a new BindStatus instance, representing a field or object status.
| |
| findEditor | back to summary |
|---|---|
| public PropertyEditor findEditor(Class<?> valueClass) Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to.
| |
| getActualValue | back to summary |
|---|---|
| public Object getActualValue() Return the actual value of the field, i.e. the raw property value,
or
| |
| getDisplayValue | back to summary |
|---|---|
| public String getDisplayValue() Return a suitable display value for the field, i.e. the stringified value if not null, and an empty string in case of a null value. This value will be an HTML-escaped String if the original value
was non-null: the | |
| getEditor | back to summary |
|---|---|
| public PropertyEditor getEditor() Return the PropertyEditor for the property that this bind status is currently bound to.
| |
| getErrorCode | back to summary |
|---|---|
| public String getErrorCode() Return the first error codes for the field or object, if any. | |
| getErrorCodes | back to summary |
|---|---|
| public String[] getErrorCodes() Return the error codes for the field or object, if any. Returns an empty array instead of null if none. | |
| getErrorMessage | back to summary |
|---|---|
| public String getErrorMessage() Return the first error message for the field or object, if any. | |
| getErrorMessages | back to summary |
|---|---|
| public String[] getErrorMessages() Return the resolved error messages for the field or object, if any. Returns an empty array instead of null if none. | |
| getErrorMessagesAsString | back to summary |
|---|---|
| public String getErrorMessagesAsString(String delimiter) Return an error message string, concatenating all messages separated by the given delimiter. | |
| getErrors | back to summary |
|---|---|
| public Errors getErrors() Return the Errors instance (typically a BindingResult) that this bind status is currently associated with.
| |
| getExpression | back to summary |
|---|---|
| public String getExpression() Return a bind expression that can be used in HTML forms as input name
for the respective field, or Returns a bind path appropriate for resubmission, e.g. "address.street". Note that the complete bind path as required by the bind tag is "customer.address.street", if bound to a "customer" bean.
| |
| getPath | back to summary |
|---|---|
| public String getPath() Return the bean and property path for which values and errors will be resolved (e.g. "customer.address.street"). | |
| getValue | back to summary |
|---|---|
| public Object getValue() Return the current value of the field, i.e. either the property value
or a rejected update, or This value will be an HTML-escaped String if the original value already was a String.
| |
| getValueType | back to summary |
|---|---|
| public Class Get the '
| |
| initErrorCodes | back to summary |
|---|---|
| private static String[] initErrorCodes(List<? extends ObjectError> objectErrors) Extract the error codes from the ObjectError list. | |
| initErrorMessages | back to summary |
|---|---|
| private String[] initErrorMessages() throws NoSuchMessageException Extract the error messages from the ObjectError list. | |
| isError | back to summary |
|---|---|
| public boolean isError() Return if this status represents a field or object error. | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non- | |