@Override protected void evaluateSingleValue(Object value) { // ensure that the value can be converted to a String String checkValue = null; try { checkValue = DefaultTypeConverter.INSTANCE.convert(String.class, value); } catch (TypeConversionException e) { throw new ConstraintException(ERR_NON_STRING, value); } AuthorityType type = AuthorityType.getAuthorityType(checkValue); if((type != AuthorityType.GROUP) && (type != AuthorityType.ROLE)) { throw new ConstraintException(ERR_INVALID_AUTHORITY_NAME, value, type); } } }
" Type: " + typeQName + "\n" + " Property: " + propertyQName + "\n" + " Constraint: " + e.getMessage()); eventResults.add(result);
" Type: " + typeQName + "\n" + " Property: " + propertyQName + "\n" + " Constraint: " + e.getMessage()); eventResults.add(result);
@Override protected void evaluateSingleValue(Object value) { // ensure that the value can be converted to a String String checkValue = null; try { checkValue = DefaultTypeConverter.INSTANCE.convert(String.class, value); } catch (TypeConversionException e) { throw new ConstraintException(ERR_NON_STRING, value); } AuthorityType type = AuthorityType.getAuthorityType(checkValue); if((type != AuthorityType.USER) && (type != AuthorityType.GUEST)) { throw new ConstraintException(ERR_INVALID_USERNAME, value, type); } } }
@Override protected void evaluateSingleValue(Object value) { // ensure that the value can be converted to a String String checkValue = null; try { checkValue = DefaultTypeConverter.INSTANCE.convert(String.class, value); } catch (TypeConversionException e) { throw new ConstraintException(ERR_NON_STRING, value); } AuthorityType type = AuthorityType.getAuthorityType(checkValue); if((type != AuthorityType.GROUP) && (type != AuthorityType.ROLE)) { throw new ConstraintException(ERR_INVALID_AUTHORITY_NAME, value, type); } } }
@Override protected void evaluateSingleValue(Object value) { // ensure that the value can be converted to a String String checkValue = null; try { checkValue = DefaultTypeConverter.INSTANCE.convert(String.class, value); } catch (TypeConversionException e) { throw new ConstraintException(ERR_NON_STRING, value); } AuthorityType type = AuthorityType.getAuthorityType(checkValue); if((type != AuthorityType.USER) && (type != AuthorityType.GUEST)) { throw new ConstraintException(ERR_INVALID_USERNAME, value, type); } } }
@Override public List<String> getRawAllowedValues() { List<String> result = null; try { result = loadClasspathTemplates(templatesParentClasspath, "json"); } catch (IOException e) { throw new ConstraintException("ListTemplateTypesConstraints", e); } List<String> repositoryTemplates = loadRepositoryTemplates(templatesParentRepositoryPath); result.addAll(repositoryTemplates); if (result.size() == 0) { result.add(NULL_SYSTEM_TEMPLATE); } super.setAllowedValues(result); return result; }
@Override public List<String> getRawAllowedValues() { List<String> result = null; try { result = loadClasspathTemplates(templatesParentClasspath, "json"); } catch (IOException e) { throw new ConstraintException("ListTemplateTypesConstraints", e); } List<String> repositoryTemplates = loadRepositoryTemplates(templatesParentRepositoryPath); result.addAll(repositoryTemplates); if (result.size() == 0) { result.add(NULL_SYSTEM_TEMPLATE); } super.setAllowedValues(result); return result; }