configurations = new ArrayList<ProfileConfigurationDTO>();
for (ProfileConfiguration profileConfig : profileConfigs) {
if (profileConfig.getDialectName().equals(dialect)) {
// This is a profile configuration defined for the given
// dialect.
ProfileConfigurationDTO profile = null;
ClaimConfigurationDTO claim = null;
List<ClaimConfigurationDTO> claimList = null;
List<String> hiddenClaims = null;
List<String> overriddenClaims = null;
List<String> inheritedClaims = null;
// A container for all the claims applicable to the current
// profile
// configuration.
claimList = new ArrayList<ClaimConfigurationDTO>();
hiddenClaims = profileConfig.getHiddenClaims();
if (hiddenClaims != null) {
for (Iterator<String> iter = hiddenClaims.iterator(); iter.hasNext();) {
String string = iter.next();
claim = new ClaimConfigurationDTO();
claim.setClaimUri(string);
claim.setBehavior(UserCoreConstants.CLAIM_HIDDEN);
claimList.add(claim);
}
}
overriddenClaims = profileConfig.getOverriddenClaims();
if (overriddenClaims != null) {
for (Iterator<String> iter = overriddenClaims.iterator(); iter.hasNext();) {
String string = iter.next();
claim = new ClaimConfigurationDTO();
claim.setClaimUri(string);
claim.setBehavior(UserCoreConstants.CLAIM_OVERRIDEN);
claimList.add(claim);
}
}
inheritedClaims = profileConfig.getInheritedClaims();
if (inheritedClaims != null) {
for (Iterator<String> iter = inheritedClaims.iterator(); iter.hasNext();) {
String string = iter.next();
claim = new ClaimConfigurationDTO();
claim.setClaimUri(string);
claim.setBehavior(UserCoreConstants.CLAIM_INHERITED);
claimList.add(claim);
}
}
// A given profile configuration has a claim set and a name.
profile = new ProfileConfigurationDTO();
profile.setConfigurationName(profileConfig.getProfileName());
profile.setClaimConfiguration(claimList
.toArray(new ClaimConfigurationDTO[claimList.size()]));
// Here comes one more profile configuration defined under
// the given
// dialect.
configurations.add(profile);