* reference.
* @return The list of linked attributes.
*/
protected List<UserAttributeRef> mapLinkedUserAttributes(List<UserAttribute> userAttributes, List<UserAttributeRef> userAttributeRefs)
{
UserAttributeRefImpl impl;
List<UserAttributeRef> linkedUserAttributes = new ArrayList<UserAttributeRef>();
if ((null != userAttributeRefs) && (userAttributeRefs.size() > 0))
{
for (UserAttribute currentAttribute : userAttributes)
{
boolean linkedAttribute = false;
impl = new UserAttributeRefImpl();
for (UserAttributeRef currentAttributeRef : userAttributeRefs)
{
if ((currentAttribute.getName()).equals(currentAttributeRef.getNameLink()))
{
if (log.isDebugEnabled())
{
log.debug("Linking user attribute ref: [[name, " + currentAttribute.getName()
+ "], [linked name, " + currentAttributeRef.getName() + "]]");
}
impl.setName(currentAttributeRef.getName());
impl.setNameLink(currentAttributeRef.getNameLink());
linkedAttribute = true;
break;
}
}
if (!linkedAttribute)
{
impl.setName(currentAttribute.getName());
}
linkedUserAttributes.add(impl);
}
}
else
{
for (UserAttribute currentAttribute : userAttributes)
{
impl = new UserAttributeRefImpl();
impl.setName(currentAttribute.getName());
linkedUserAttributes.add(impl);
}
}
return linkedUserAttributes;
}