| java.lang.Object org.springframework.web.servlet.support.BindStatus
Constructor Summary | |
public | BindStatus(RequestContext requestContext, String path, boolean htmlEscape) Create a new BindStatus instance, representing a field or object status.
Parameters: requestContext - the current RequestContext Parameters: path - the bean and property path for which values and errorswill be resolved (e.g. |
Method Summary | |
public String | getDisplayValue() Return a suitable display value for the field, i.e. | public PropertyEditor | getEditor() Return the PropertyEditor for the property that this bind status
is currently bound to. | public String | getErrorCode() Return the first error codes for the field or object, if any. | public String[] | getErrorCodes() Return the error codes for the field or object, if any. | public String | getErrorMessage() Return the first error message for the field or object, if any. | public String[] | getErrorMessages() Return the resolved error messages for the field or object,
if any. | public String | getErrorMessagesAsString(String delimiter) Return an error message string, concatenating all messages
separated by the given delimiter.
Parameters: delimiter - separator string, e.g. | public Errors | getErrors() Return 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 null if not field-specific.
Returns a bind path appropriate for resubmission, e.g. | public String | getPath() Return the bean and property path for which values and errors
will be resolved (e.g. | public Object | getValue() Return the current value of the field, i.e. | public Class | getValueType() Gets the 'Class ' type of the field. | public boolean | isError() Return if this status represents a field or object error. | public String | toString() |
BindStatus | public BindStatus(RequestContext requestContext, String path, boolean htmlEscape) throws IllegalStateException(Code) | | Create a new BindStatus instance, representing a field or object status.
Parameters: requestContext - the current RequestContext Parameters: path - the bean and property path for which values and errorswill be resolved (e.g. "customer.address.street") Parameters: htmlEscape - whether to HTML-escape error messages and string values throws: IllegalStateException - if no corresponding Errors object found |
getDisplayValue | public String getDisplayValue()(Code) | | 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 toString result of the original value
will get HTML-escaped.
|
getEditor | public PropertyEditor getEditor()(Code) | | Return the PropertyEditor for the property that this bind status
is currently bound to.
the current PropertyEditor, or null if none |
getErrorCode | public String getErrorCode()(Code) | | Return the first error codes for the field or object, if any.
|
getErrorCodes | public String[] getErrorCodes()(Code) | | Return the error codes for the field or object, if any.
Returns an empty array instead of null if none.
|
getErrorMessage | public String getErrorMessage()(Code) | | Return the first error message for the field or object, if any.
|
getErrorMessages | public String[] getErrorMessages()(Code) | | Return the resolved error messages for the field or object,
if any. Returns an empty array instead of null if none.
|
getErrorMessagesAsString | public String getErrorMessagesAsString(String delimiter)(Code) | | Return an error message string, concatenating all messages
separated by the given delimiter.
Parameters: delimiter - separator string, e.g. ", " or " " the error message string |
getExpression | public String getExpression()(Code) | | Return a bind expression that can be used in HTML forms as input name
for the respective field, or null if not field-specific.
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 | public String getPath()(Code) | | Return the bean and property path for which values and errors
will be resolved (e.g. "customer.address.street").
|
getValue | public Object getValue()(Code) | | Return the current value of the field, i.e. either the property value
or a rejected update, or null if not field-specific.
This value will be an HTML-escaped String if the original value
already was a String.
|
getValueType | public Class getValueType()(Code) | | Gets the 'Class ' type of the field. Favour this instead of
'getValue().getClass() ' since 'getValue() ' may
return 'null '.
|
isError | public boolean isError()(Code) | | Return if this status represents a field or object error.
|
|
|