class BasicInputControlHandler implements InputControlHandler {

    protected List<ValidationRule> getValidationRules(InputControl inputControl) throws CascadeResourceNotFoundException {
        List<ValidationRule> validationRules = new ArrayList<ValidationRule>();
        if (inputControl.isMandatory()) {
            final MandatoryValidationRule mandatoryValidationRule = new MandatoryValidationRule();
            mandatoryValidationRule.setErrorMessage(getMessage(MandatoryValidationRule.ERROR_KEY));
            validationRules.add(mandatoryValidationRule);
        }
        final DataType dataType = inputControl.getDataType() != null ? cachedRepositoryService.getResource(DataType.class, inputControl.getDataType()) : null;
        if(dataType != null){
            switch (dataType.getDataTypeType()){
                case DataType.TYPE_DATE:{
                    final DateTimeFormatValidationRule dateFormatValidationRule = new DateTimeFormatValidationRule();
                    dateFormatValidationRule.setFormat(calendarFormatProvider.getDatePattern());
                    dateFormatValidationRule.setErrorMessage(getMessage(DateTimeFormatValidationRule.INVALID_DATE));
                    validationRules.add(dateFormatValidationRule);
                }
                break;
                case DataType.TYPE_DATE_TIME:{
                    final DateTimeFormatValidationRule dateTimeFormatValidationRule = new DateTimeFormatValidationRule();
                    dateTimeFormatValidationRule.setFormat(calendarFormatProvider.getDatetimePattern());
                    dateTimeFormatValidationRule.setErrorMessage(getMessage(DateTimeFormatValidationRule.INVALID_DATE_TIME));
                    validationRules.add(dateTimeFormatValidationRule);
                }
                break;
                case DataType.TYPE_TIME:{
                    final DateTimeFormatValidationRule dateTimeFormatValidationRule = new DateTimeFormatValidationRule();
                    dateTimeFormatValidationRule.setFormat(calendarFormatProvider.getTimePattern());
                    dateTimeFormatValidationRule.setErrorMessage(getMessage(DateTimeFormatValidationRule.INVALID_TIME));
                    validationRules.add(dateTimeFormatValidationRule);
                }
                break;
            }
        }
        return validationRules;
    }

}