List<AttributeStatement> attributeStatements = new ArrayList<AttributeStatement>();
if (attributeData != null && attributeData.size() > 0) {
for (AttributeStatementBean statementBean : attributeData) {
// Create the attribute statementBean and set the subject
AttributeStatement attributeStatement = attributeStatementV1Builder.buildObject();
Subject attributeSubject =
SAML1ComponentBuilder.createSaml1v1Subject(statementBean.getSubject());
attributeStatement.setSubject(attributeSubject);
// Add the individual attributes
for (AttributeBean values : statementBean.getSamlAttributes()) {
List<?> attributeValues = values.getAttributeValues();
if (attributeValues == null || attributeValues.isEmpty()) {
attributeValues = values.getCustomAttributeValues();
}
Attribute samlAttribute =
createSamlv1Attribute(
values.getSimpleName(),
values.getQualifiedName(),
attributeValues
);
attributeStatement.getAttributes().add(samlAttribute);
}
// Add the completed attribute statementBean to the collection
attributeStatements.add(attributeStatement);
}
}