public static StandardValidation getInstance() { return new StandardValidation(); } }
@Override public <T extends ValidationListener> void validate(ValidationContext<T> context) { validateMandatory(context); validateMaxLength(context); validateMinLength(context); validateMaxValue(context); validateMinValue(context); validateRegExp(context); validateTimeLag(context); }
protected <T extends ValidationListener> void validateMaxValue(ValidationContext<T> context) { @SuppressWarnings("unchecked") Comparable<Object> maxValue = (Comparable<Object>) context.getMetaProperty().getFeature(MAX_VALUE); if (maxValue == null || context.getPropertyValue() == null) return; if (compare(context, maxValue, context.getPropertyValue()) < 0) { context.getListener().addError(MAX_VALUE, context); } }
if (standardValidation != null && valRef.getRefId().equals(standardValidation.getValidationId())) { useStandard = false;
protected <T extends ValidationListener> void validateMinValue(ValidationContext<T> context) { @SuppressWarnings("unchecked") Comparable<Object> minValue = (Comparable<Object>) context.getMetaProperty().getFeature(MIN_VALUE); if (minValue == null || context.getPropertyValue() == null) return; if (compare(context, minValue, context.getPropertyValue()) > 0) { context.getListener().addError(MIN_VALUE, context); } }