| java.lang.Object org.jaffa.datatypes.FieldValidator
FieldValidator | public class FieldValidator (Code) | | This class has convenience methods for validating data.
|
Method Summary | |
public static String | validate(String field, StringFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: TooMuchDataException - if the length of the field exceeds the limit specified in the meta data. throws: TooLittleDataException - if the length of the field is below the value specified in the meta data. throws: PatternMismatchException - if the field does not conform to the pattern specified in the meta data. | public static Boolean | validate(Boolean field, BooleanFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. | public static Currency | validate(Currency field, CurrencyFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: TooMuchDataException - if the length of the field exceeds the limit specified in the meta data. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. | public static DateOnly | validate(DateOnly field, DateOnlyFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. | public static DateTime | validate(DateTime field, DateTimeFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. | public static Double | validate(Double field, DecimalFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: TooMuchDataException - if the length of the field exceeds the limit specified in the meta data. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. | public static Long | validate(Long field, IntegerFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: TooMuchDataException - if the length of the field exceeds the limit specified in the meta data. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. | public static byte[] | validate(byte[] field, RawFieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. | public static Object | validateData(String field, FieldMetaData meta) This method validates the input field value based on the meta data.
This will not check the mandatory property.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. throws: MandatoryFieldException - if the field is null. | public static Object | validateData(String field, FieldMetaData meta, boolean checkMandatory) This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: TooMuchDataException - if the length of the field exceeds the limit specified in the meta data. throws: TooLittleDataException - if the length of the field is below the value specified in the meta data. throws: PatternMismatchException - if the field does not conform to the pattern specified in the meta data. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. throws: FormatCurrencyException - if the field has an invalid currency format. |
validate | public static Boolean validate(Boolean field, BooleanFieldMetaData meta, boolean checkMandatory) throws MandatoryFieldException(Code) | | This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. the parsed object corresponding to the input field. |
validate | public static DateOnly validate(DateOnly field, DateOnlyFieldMetaData meta, boolean checkMandatory) throws MandatoryFieldException, BelowMinimumException, ExceedsMaximumException(Code) | | This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. the parsed object corresponding to the input field. |
validate | public static DateTime validate(DateTime field, DateTimeFieldMetaData meta, boolean checkMandatory) throws MandatoryFieldException, BelowMinimumException, ExceedsMaximumException(Code) | | This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. the parsed object corresponding to the input field. |
validate | public static byte[] validate(byte[] field, RawFieldMetaData meta, boolean checkMandatory) throws MandatoryFieldException(Code) | | This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. the parsed object corresponding to the input field. |
validateData | public static Object validateData(String field, FieldMetaData meta) throws MandatoryFieldException, TooMuchDataException, TooLittleDataException, PatternMismatchException, BelowMinimumException, ExceedsMaximumException, FormatCurrencyException, FormatDateOnlyException, FormatDateTimeException, FormatDecimalException, FormatIntegerException(Code) | | This method validates the input field value based on the meta data.
This will not check the mandatory property.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. throws: MandatoryFieldException - if the field is null. This should never happen. throws: TooMuchDataException - if the length of the field exceeds the limit specified in the meta data. throws: TooLittleDataException - if the length of the field is below the value specified in the meta data. throws: PatternMismatchException - if the field does not conform to the pattern specified in the meta data. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. throws: FormatCurrencyException - if the field has an invalid currency format. This can happen for Currency fields only. throws: FormatDateOnlyException - if the field has an invalid date format. This can happen for DateOnly fields only. throws: FormatDateTimeException - if the field has an invalid datetime format. This can happen for DateTime fields only. throws: FormatDecimalException - if the field has an invalid decimal format. This can happen for Decimal fields only. throws: FormatIntegerException - if the field has an invalid integer format. This can happen for Integer fields only. the parsed object corresponding to the input field. |
validateData | public static Object validateData(String field, FieldMetaData meta, boolean checkMandatory) throws MandatoryFieldException, TooMuchDataException, TooLittleDataException, PatternMismatchException, BelowMinimumException, ExceedsMaximumException, FormatCurrencyException, FormatDateOnlyException, FormatDateTimeException, FormatDecimalException, FormatIntegerException(Code) | | This method validates the input field value based on the meta data.
It then returns the parsed object corresponding to the input field.
Parameters: field - the value to validate. Parameters: meta - the meta object based on which the validation is to be performed. Parameters: checkMandatory - determines if the mandatory check is to be performed. throws: MandatoryFieldException - if checkMandatory is true and the field is null. throws: TooMuchDataException - if the length of the field exceeds the limit specified in the meta data. throws: TooLittleDataException - if the length of the field is below the value specified in the meta data. throws: PatternMismatchException - if the field does not conform to the pattern specified in the meta data. throws: BelowMinimumException - if the field has a value less than the minimum value specified in the meta data. throws: ExceedsMaximumException - if the field has a value greater than the maximum value specified in the meta data. throws: FormatCurrencyException - if the field has an invalid currency format. This can happen for Currency fields only. throws: FormatDateOnlyException - if the field has an invalid date format. This can happen for DateOnly fields only. throws: FormatDateTimeException - if the field has an invalid datetime format. This can happen for DateTime fields only. throws: FormatDecimalException - if the field has an invalid decimal format. This can happen for Decimal fields only. throws: FormatIntegerException - if the field has an invalid integer format. This can happen for Integer fields only. the parsed object corresponding to the input field. |
|
|