The role-name element must conform to the lexical rules for an NMTOKEN
Result result = getInitializedResult();
ComponentNameConstructor compName = getVerifierContext().getComponentNameConstructor();
if (!descriptor.getPermissionedRoles().isEmpty()) {
for (Iterator itr = descriptor.getPermissionedRoles().iterator();
itr.hasNext();) {
Role nextRole = (Role) itr.next();
if (NameToken.isNMTOKEN(nextRole.getName())) {
result.addGoodDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.addGoodDetails
(smh.getLocalString
(getClass().getName() + ".passed",
"Role name [ {0} ] conforms to the lexical rules of NMTOKEN within bean [ {1} ]",
new Object[] {nextRole.getName(), descriptor.getName()}));
if (result.getStatus()!= Result.FAILED)
result.setStatus(Result.PASSED);
} else {
result.addErrorDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.failed
(smh.getLocalString
(getClass().getName() + ".failed",
"Role name [ {0} ] does not conform to the lexical rules of NMTOKEN within bean [ {1} ]",
new Object[] {nextRole.getName(), descriptor.getName()}));
}
}
} else {
result.addNaDetails(smh.getLocalString
("tests.componentNameConstructor",
"For [ {0} ]",
new Object[] {compName.toString()}));
result.notApplicable(smh.getLocalString
(getClass().getName() + ".notApplicable",
"No permissioned roles defined for this bean [ {0} ]",
new Object[] {descriptor.getName()}));
}
return result;