Errors interface.
Provides nested path handling but does not define concrete management
of ObjectErrors and FieldErrors.
AbstractBindingResult
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected String | Returns: the canonical field namethe original field name field)Determine the canonical field name for the given field. |
| protected void | |
| protected String | fixedField(String field)
Transform the given field into its full path, regarding the nested path of this instance. |
| public List | getFieldErrors(String
the field name field)Overrides default org. |
| public String | getNestedPath()
Overrides default org. Errors object.
|
| protected boolean | Returns: whether the FieldError matches the given fieldthe field that we are looking up FieldErrors for field, FieldError the candidate FieldError fieldError)Check whether the given FieldError matches the given field. |
| public void | popNestedPath()
Overrides default org. |
| public void | pushNestedPath(String
the sub path to push onto the nested path stack subPath)Overrides default org. |
| public void | setNestedPath(String
nested path within this object,
e.g. "address" (defaults to "", nestedPath)null is also acceptable).
Can end with a dot: both "address" and "address." are valid.Overrides default org. |
| public String | toString()
Overrides java. Implements org. |
| nestedPath | back to summary |
|---|---|
| private String nestedPath | |
| nestedPathStack | back to summary |
|---|---|
| private final Deque<String> nestedPathStack | |
| AbstractErrors | back to summary |
|---|---|
| public AbstractErrors() | |
| canonicalFieldName | back to summary |
|---|---|
| protected String canonicalFieldName(String field) Determine the canonical field name for the given field. The default implementation simply returns the field name as-is. | |
| doSetNestedPath | back to summary |
|---|---|
| protected void doSetNestedPath(String nestedPath) Actually set the nested path. Delegated to by setNestedPath and pushNestedPath. | |
| fixedField | back to summary |
|---|---|
| protected String fixedField(String field) Transform the given field into its full path, regarding the nested path of this instance. | |
| getFieldErrors | back to summary |
|---|---|
| public List Overrides default org. Doc from org. Get all errors associated with the given field. Implementations may support not only full field names like "address.street" but also pattern matches like "address.*".
| |
| getNestedPath | back to summary |
|---|---|
| public String getNestedPath() Overrides default org. Doc from org. Return the current nested path of this Returns a nested path with a dot, i.e. "address.", for easy building of concatenated paths. Default is an empty String.
| |
| isMatchingFieldError | back to summary |
|---|---|
| protected boolean isMatchingFieldError(String field, FieldError fieldError) Check whether the given FieldError matches the given field.
| |
| popNestedPath | back to summary |
|---|---|
| public void popNestedPath() throws IllegalStateException Overrides default org. Doc from org. Pop the former nested path from the nested path stack.
| |
| pushNestedPath | back to summary |
|---|---|
| public void pushNestedPath(String subPath) Overrides default org. Doc from org. Push the given sub path onto the nested path stack. A Using the nested path stack allows to set temporary nested paths for subobjects without having to worry about a temporary path holder. For example: current path "spouse.", pushNestedPath("child") → result path "spouse.child."; popNestedPath() → "spouse." again. The default implementation throws | |
| setNestedPath | back to summary |
|---|---|
| public void setNestedPath(String nestedPath) Overrides default org. Doc from org. Allow context to be changed so that standard validators can validate subtrees. Reject calls prepend the given path to the field names. For example, an address validator could validate the subobject "address" of a customer object. The default implementation throws | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements org. Doc from org. Return a summary of the recorded errors, e.g. for inclusion in an exception message.
| |