String tokenType = providerParameters.getTokenRequirements().getTokenType();
AttributeStatementBean attrBean = new AttributeStatementBean();
while (claimIterator.hasNext()) {
ProcessedClaim claim = claimIterator.next();
AttributeBean attributeBean = new AttributeBean();
URI claimType = claim.getClaimType();
if (WSConstants.WSS_SAML2_TOKEN_TYPE.equals(tokenType)
|| WSConstants.SAML2_NS.equals(tokenType)) {
attributeBean.setQualifiedName(claimType.toString());
attributeBean.setNameFormat(nameFormat);
} else {
String uri = claimType.toString();
int lastSlash = uri.lastIndexOf("/");
if (lastSlash == (uri.length() - 1)) {
uri = uri.substring(0, lastSlash);
lastSlash = uri.lastIndexOf("/");
}
String namespace = uri.substring(0, lastSlash);
String name = uri.substring(lastSlash + 1, uri.length());
attributeBean.setSimpleName(name);
attributeBean.setQualifiedName(namespace);
}
attributeBean.setAttributeValues(claim.getValues());
attributeList.add(attributeBean);
}
attrBean.setSamlAttributes(attributeList);