Package com.saperion.ngc.iform.validator
Class AbstractFieldValidator<T extends IntelligentField>
java.lang.Object
com.saperion.ngc.iform.validator.AbstractFieldValidator<T>
- Type Parameters:
T
- type of the field to validate
- Direct Known Subclasses:
AdvancedLookupFieldValidator
,DateFieldValidator
,GenericFieldValidator
,LookupFieldValidator
,MultiFieldValidator
,TextFieldValidator
Abstract base class for all field validators.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
checkDateRange
(Date value) Checks if the date is within the range supported by the database-system in use.protected void
Checks if mandatory field is set.protected void
checkLengthOfInput
(String text) Checks the length of the field's value.abstract void
validate()
Validates the field.
-
Field Details
-
field
The field to validate.
-
-
Constructor Details
-
AbstractFieldValidator
- Parameters:
field
- the field to validate
-
-
Method Details
-
validate
public abstract void validate() throws FieldValidationException, AuthenticationException, SystemExceptionValidates the field.- Throws:
FieldValidationException
- when the value of the field is not validAuthenticationException
- re-logon requiredSystemException
-
checkIfMandatoryFieldIsSet
Checks if mandatory field is set. Can be applied to all kinds of fields.- Throws:
FieldValidationException
- when the field is mandatory but has no value set
-
checkLengthOfInput
Checks the length of the field's value. Can be applied to string-fields only.- Parameters:
text
- the value of the field- Throws:
FieldValidationException
- when the length of the field's value exceeds the specified maximum length
-
checkDateRange
protected void checkDateRange(Date value) throws FieldValidationException, AuthenticationException, SystemException Checks if the date is within the range supported by the database-system in use. Can be applied to date-fields only.- Parameters:
value
- the value of the field- Throws:
FieldValidationException
- when the date entered in the field is not in the supported rangeAuthenticationException
SystemException
-