|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.web.servlet.support.BindStatus
Simple adapter to expose the bind status of a field or object. Set as a variable both by the JSP bind tag and Velocity/FreeMarker macros.
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(java.lang.String)
,
BindTag
Field Summary | |
protected org.apache.commons.logging.Log |
logger
|
Constructor Summary | |
BindStatus(RequestContext requestContext,
java.lang.String path,
boolean htmlEscape)
Create a new BindStatus instance, representing a field or object status. |
Method Summary | |
java.lang.String |
getDisplayValue()
Return a suitable display value for the field, i.e. empty string instead of a null value, or null if not field-specific. |
java.beans.PropertyEditor |
getEditor()
Return the PropertyEditor for the property that this bind status is currently bound to. |
java.lang.String |
getErrorCode()
Return the first error codes for the field or object, if any. |
java.lang.String[] |
getErrorCodes()
Return the error codes for the field or object, if any. |
java.lang.String |
getErrorMessage()
Return the first error message for the field or object, if any. |
java.lang.String[] |
getErrorMessages()
Return the resolved error messages for the field or object, if any. |
java.lang.String |
getErrorMessagesAsString(java.lang.String delimiter)
Return an error message string, concatenating all messages separated by the given delimiter. |
Errors |
getErrors()
Return the Errors instance that this bind status is currently bound to. |
java.lang.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. |
java.lang.String |
getPath()
Return the bean and property path for which values and errors will be resolved (e.g. |
java.lang.Object |
getValue()
Return the current value of the field, i.e. either the property value or a rejected update, or null if not field-specific. |
boolean |
isError()
Return if this status represents a field or object error. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final org.apache.commons.logging.Log logger
Constructor Detail |
public BindStatus(RequestContext requestContext, java.lang.String path, boolean htmlEscape) throws java.lang.IllegalStateException
requestContext
- the current RequestContextpath
- the bean and property path for which values and errors
will be resolved (e.g. "customer.address.street")htmlEscape
- whether to HTML-escape error messages and string values
java.lang.IllegalStateException
- if no corresponding Errors object foundMethod Detail |
public java.lang.String getPath()
public java.lang.String getExpression()
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.
public java.lang.Object getValue()
public java.lang.String getDisplayValue()
public boolean isError()
public java.lang.String[] getErrorCodes()
public java.lang.String getErrorCode()
public java.lang.String[] getErrorMessages()
public java.lang.String getErrorMessage()
public java.lang.String getErrorMessagesAsString(java.lang.String delimiter)
delimiter
- separator string, e.g. ", " or "public Errors getErrors()
public java.beans.PropertyEditor getEditor()
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |