class VirtualDataSourceValidator extends DefaultResourceValidator {

    public boolean validateSubDsId(String value, String nameField, ValidationErrors errors) {
        if(!validateNameString(value, nameField, errors)) {
            return false;
        }

        if(subDsIdInvalidChars.matcher(value).find()) {
            errors.add(new ValidationErrorImpl(getErrorMessagePrefix() + "error.invalid.chars", null, "Only letters, digits and underscore allowed in subDsId", nameField));
        }
        if(!StringUtils.isEmpty(value)) {
            char firstChar = value.charAt(0);
            if(firstChar == '_' || Character.isDigit(firstChar)) {
                errors.add(new ValidationErrorImpl(getErrorMessagePrefix() + "error.first.letter.required", null, "Should start with letter", nameField));
            }
        }
        return true;
    }

}