Class BaseValidator
- java.lang.Object
-
- org.zkoss.bind.validator.AbstractValidator
-
- org.openforis.collect.designer.form.validator.BaseValidator
-
- All Implemented Interfaces:
org.zkoss.bind.Validator
- Direct Known Subclasses:
FormValidator,SurveyNameValidator
public abstract class BaseValidator extends org.zkoss.bind.validator.AbstractValidator- Author:
- S. Ricci
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringFIELD_REQUIRED_MESSAGE_KEYprotected static StringGREATER_THAN_EQUAL_MESSAGE_KEYprotected static StringGREATER_THAN_MESSAGE_KEYprotected static StringINTERNAL_NAME_INVALID_VALUE_ERROR_KEYprotected static StringINVALID_URI_MESSAGE_KEYprotected static StringITEM_NAME_ALREADY_DEFINED_MESSAGE_KEYprotected static StringLESS_THAN_EQUAL_MESSAGE_KEYprotected static StringLESS_THAN_MESSAGE_KEY
-
Constructor Summary
Constructors Constructor Description BaseValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringcreateCompareMessage(String strictMessageKey, String notStrictMessageKey, boolean strict, Number compareValue, String compareValueLabel)protected DoublegetNumericValue(org.zkoss.bind.ValidationContext ctx, String field)protected Map<String,org.zkoss.bind.Property>getProperties(org.zkoss.bind.ValidationContext ctx)protected <T> TgetValue(org.zkoss.bind.ValidationContext ctx, String fieldName)Returns the actual value of a field.protected <T> TgetValue(org.zkoss.bind.ValidationContext ctx, String fieldName, boolean required)protected <T> TgetValueWithDefault(org.zkoss.bind.ValidationContext ctx, String fieldName, T defaultValue)protected <T extends BaseVM>
TgetVM(org.zkoss.bind.ValidationContext ctx)protected booleanisNumber(Object value)protected booleanisNumber(org.zkoss.bind.ValidationContext ctx, String field)protected booleanvalidateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value)protected booleanvalidateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value, boolean strict)protected booleanvalidateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number compareValue, String compareValueLabel, boolean strict)protected booleanvalidateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, String compareFieldName, String compareFieldLabel, boolean strict)protected booleanvalidateInternalName(org.zkoss.bind.ValidationContext ctx, String fieldName)protected booleanvalidateInternalName(org.zkoss.bind.ValidationContext ctx, String fieldName, String validationMessageKey)protected booleanvalidateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value)protected booleanvalidateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value, boolean strict)protected booleanvalidateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number compareValue, String compareValueLabel, boolean strict)protected booleanvalidateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, String compareFieldName, String compareFieldLabel, boolean strict)protected booleanvalidateRegEx(org.zkoss.bind.ValidationContext ctx, String regex, String fieldName, String errorMessageKey)protected booleanvalidateRegEx(org.zkoss.bind.ValidationContext ctx, String regex, String fieldName, String errorMessageKey, String validationMessageKey)protected booleanvalidateRegEx(org.zkoss.bind.ValidationContext ctx, Pattern pattern, String fieldName, String errorMessageKey)protected booleanvalidateRegEx(org.zkoss.bind.ValidationContext ctx, Pattern pattern, String fieldName, String errorMessageKey, String validationMessageKey)protected booleanvalidateRegExValue(org.zkoss.bind.ValidationContext ctx, Pattern pattern, Object value, String errorMessageKey, String validationMessageKey)protected booleanvalidateRequired(org.zkoss.bind.ValidationContext ctx, String fieldName)protected booleanvalidateRequired(org.zkoss.bind.ValidationContext ctx, String validationMessageKey, Object value)protected booleanvalidateRequired(org.zkoss.bind.ValidationContext ctx, String fieldName, String validationMessageKey)protected booleanvalidateUri(org.zkoss.bind.ValidationContext ctx, String fieldName)-
Methods inherited from class org.zkoss.bind.validator.AbstractValidator
addInvalidMessage, addInvalidMessage, addInvalidMessage, addInvalidMessages, addInvalidMessages, addInvalidMessages
-
-
-
-
Field Detail
-
INTERNAL_NAME_INVALID_VALUE_ERROR_KEY
protected static final String INTERNAL_NAME_INVALID_VALUE_ERROR_KEY
- See Also:
- Constant Field Values
-
FIELD_REQUIRED_MESSAGE_KEY
protected static final String FIELD_REQUIRED_MESSAGE_KEY
- See Also:
- Constant Field Values
-
INVALID_URI_MESSAGE_KEY
protected static final String INVALID_URI_MESSAGE_KEY
- See Also:
- Constant Field Values
-
GREATER_THAN_MESSAGE_KEY
protected static final String GREATER_THAN_MESSAGE_KEY
- See Also:
- Constant Field Values
-
GREATER_THAN_EQUAL_MESSAGE_KEY
protected static final String GREATER_THAN_EQUAL_MESSAGE_KEY
- See Also:
- Constant Field Values
-
LESS_THAN_MESSAGE_KEY
protected static final String LESS_THAN_MESSAGE_KEY
- See Also:
- Constant Field Values
-
LESS_THAN_EQUAL_MESSAGE_KEY
protected static final String LESS_THAN_EQUAL_MESSAGE_KEY
- See Also:
- Constant Field Values
-
ITEM_NAME_ALREADY_DEFINED_MESSAGE_KEY
protected static final String ITEM_NAME_ALREADY_DEFINED_MESSAGE_KEY
- See Also:
- Constant Field Values
-
-
Method Detail
-
validateRequired
protected boolean validateRequired(org.zkoss.bind.ValidationContext ctx, String validationMessageKey, Object value)
-
validateRequired
protected boolean validateRequired(org.zkoss.bind.ValidationContext ctx, String fieldName)
-
validateRequired
protected boolean validateRequired(org.zkoss.bind.ValidationContext ctx, String fieldName, String validationMessageKey)
-
validateInternalName
protected boolean validateInternalName(org.zkoss.bind.ValidationContext ctx, String fieldName)
-
validateInternalName
protected boolean validateInternalName(org.zkoss.bind.ValidationContext ctx, String fieldName, String validationMessageKey)
-
validateRegEx
protected boolean validateRegEx(org.zkoss.bind.ValidationContext ctx, String regex, String fieldName, String errorMessageKey)
-
validateRegEx
protected boolean validateRegEx(org.zkoss.bind.ValidationContext ctx, String regex, String fieldName, String errorMessageKey, String validationMessageKey)
-
validateRegEx
protected boolean validateRegEx(org.zkoss.bind.ValidationContext ctx, Pattern pattern, String fieldName, String errorMessageKey)
-
validateRegEx
protected boolean validateRegEx(org.zkoss.bind.ValidationContext ctx, Pattern pattern, String fieldName, String errorMessageKey, String validationMessageKey)
-
validateRegExValue
protected boolean validateRegExValue(org.zkoss.bind.ValidationContext ctx, Pattern pattern, Object value, String errorMessageKey, String validationMessageKey)
-
validateUri
protected boolean validateUri(org.zkoss.bind.ValidationContext ctx, String fieldName)
-
validateGreaterThan
protected boolean validateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value)
-
validateGreaterThan
protected boolean validateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value, boolean strict)
-
validateGreaterThan
protected boolean validateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, String compareFieldName, String compareFieldLabel, boolean strict)
-
validateGreaterThan
protected boolean validateGreaterThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number compareValue, String compareValueLabel, boolean strict)
-
validateLessThan
protected boolean validateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value)
-
validateLessThan
protected boolean validateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number value, boolean strict)
-
validateLessThan
protected boolean validateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, String compareFieldName, String compareFieldLabel, boolean strict)
-
validateLessThan
protected boolean validateLessThan(org.zkoss.bind.ValidationContext ctx, String fieldName, Number compareValue, String compareValueLabel, boolean strict)
-
createCompareMessage
protected String createCompareMessage(String strictMessageKey, String notStrictMessageKey, boolean strict, Number compareValue, String compareValueLabel)
-
getValue
protected <T> T getValue(org.zkoss.bind.ValidationContext ctx, String fieldName)Returns the actual value of a field.- Parameters:
ctx-fieldName- (Optional)- Returns:
-
getValueWithDefault
protected <T> T getValueWithDefault(org.zkoss.bind.ValidationContext ctx, String fieldName, T defaultValue)
-
getValue
protected <T> T getValue(org.zkoss.bind.ValidationContext ctx, String fieldName, boolean required)
-
getNumericValue
protected Double getNumericValue(org.zkoss.bind.ValidationContext ctx, String field)
-
isNumber
protected boolean isNumber(org.zkoss.bind.ValidationContext ctx, String field)
-
isNumber
protected boolean isNumber(Object value)
-
getProperties
protected Map<String,org.zkoss.bind.Property> getProperties(org.zkoss.bind.ValidationContext ctx)
-
getVM
protected <T extends BaseVM> T getVM(org.zkoss.bind.ValidationContext ctx)
-
-