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
public abstract class AbstractFieldValidator<T extends IntelligentField> extends java.lang.Object
Abstract base class for all field validators.
-
-
Constructor Summary
Constructors Constructor Description AbstractFieldValidator(T field)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected void
checkDateRange(java.util.Date value)
Checks if the date is within the range supported by the database-system in use.protected void
checkIfMandatoryFieldIsSet()
Checks if mandatory field is set.protected void
checkLengthOfInput(java.lang.String text)
Checks the length of the field's value.abstract void
validate()
Validates the field.
-
-
-
Field Detail
-
field
protected final T extends IntelligentField field
The field to validate.
-
-
Constructor Detail
-
AbstractFieldValidator
public AbstractFieldValidator(T field)
- Parameters:
field
- the field to validate
-
-
Method Detail
-
validate
public abstract void validate() throws FieldValidationException, AuthenticationException, SystemException
Validates the field.- Throws:
FieldValidationException
- when the value of the field is not validAuthenticationException
- re-logon requiredSystemException
-
checkIfMandatoryFieldIsSet
protected void checkIfMandatoryFieldIsSet() throws FieldValidationException
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
protected void checkLengthOfInput(java.lang.String text) throws FieldValidationException
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(java.util.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
-
-