public class ValidationInfo
extends java.lang.Object
Constructor and Description |
---|
ValidationInfo(SlingHttpServletRequest request)
Construct a new validation info.
|
Modifier and Type | Method and Description |
---|---|
static void |
addConstraintError(SlingHttpServletRequest request,
FieldDescription desc)
Add the error message for the constraint of the field.
|
static void |
addConstraintError(SlingHttpServletRequest request,
FieldDescription desc,
int valueIndex)
Add the error message for the constraint of the field.
|
void |
addErrorMessage(java.lang.String field,
java.lang.String msg)
Add the error message for the field.
|
static ValidationInfo |
createValidationInfo(SlingHttpServletRequest req)
Return the validation information for a request.
|
java.lang.String[] |
getErrorMessages(java.lang.String field)
Return all error messages for this parameter.
|
java.lang.String[] |
getErrorMessages(java.lang.String field,
int valueIndex)
Return all error messages for this parameter.
|
java.lang.String |
getFormId()
Return the form id.
|
static ValidationInfo |
getValidationInfo(HttpServletRequest req)
Return the validation information for a request
|
java.lang.String[] |
getValues(java.lang.String field)
Return all values for a field.
|
public ValidationInfo(SlingHttpServletRequest request)
request
- The current request.public java.lang.String[] getValues(java.lang.String field)
field
- The name of the field.null
public void addErrorMessage(java.lang.String field, java.lang.String msg)
field
- The name of the field or null
msg
- The error message.public static void addConstraintError(SlingHttpServletRequest request, FieldDescription desc)
request
- The current request usually targetting a constraint resource.desc
- The field description.public static void addConstraintError(SlingHttpServletRequest request, FieldDescription desc, int valueIndex)
request
- The current request usually targetting a constraint resource.desc
- The field description.valueIndex
- The value index.public java.lang.String getFormId()
null
public java.lang.String[] getErrorMessages(java.lang.String field)
field
- Parameter name or null
to get global errors.null
if there are no messagespublic java.lang.String[] getErrorMessages(java.lang.String field, int valueIndex)
field
- Parameter name or null
to get global errors.valueIndex
- value indexnull
if there are no messagespublic static ValidationInfo getValidationInfo(HttpServletRequest req)
req
- The current request.null
public static ValidationInfo createValidationInfo(SlingHttpServletRequest req)
req
- The current request."Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"