open class BindStatus
Simple adapter to expose the bind status of a field or object. Set as a variable by FreeMarker macros and other tag libraries.
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.
Author
Rossen Stoyanchev
Since
5.0
See Also
RequestContext#getBindStatus
BindStatus(requestContext: RequestContext, path: String, htmlEscape: Boolean)
Create a new BindStatus instance, representing a field or object status. |
open fun findEditor(valueClass: Class<*>): PropertyEditor
Find a PropertyEditor for the given value class, associated with the property that this bound status is currently bound to. |
|
open fun getActualValue(): Any
Return the actual value of the field, i.e. the raw property value, or |
|
open fun getDisplayValue(): String
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 |
|
open fun getEditor(): PropertyEditor
Return the PropertyEditor for the property that this bind status is currently bound to. |
|
open fun getErrorCode(): String
Return the first error codes for the field or object, if any. |
|
open fun getErrorCodes(): Array<String>
Return the error codes for the field or object, if any. Returns an empty array instead of null if none. |
|
open fun getErrorMessage(): String
Return the first error message for the field or object, if any. |
|
open fun getErrorMessages(): Array<String>
Return the resolved error messages for the field or object, if any. Returns an empty array instead of null if none. |
|
open fun getErrorMessagesAsString(delimiter: String): String
Return an error message string, concatenating all messages separated by the given delimiter. |
|
open fun getErrors(): Errors
Return the Errors instance (typically a BindingResult) that this bind status is currently associated with. |
|
open fun getExpression(): String
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. |
|
open fun getPath(): String
Return the bean and property path for which values and errors will be resolved (e.g. "customer.address.street"). |
|
open fun getValue(): Any
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. |
|
open fun getValueType(): Class<*>
Get the ' |
|
open fun isError(): Boolean
Return if this status represents a field or object error. |
|
open fun toString(): String |