Map<String, Attribute<?>> attributes = new HashMap<String, Attribute<?>>();
for (AttributeInfo attrInfo : featureInfo.getAttributes()) {
if (attrInfo instanceof PrimitiveAttributeInfo) {
attributes.put(attrInfo.getName(), createPrimitiveAttribute((PrimitiveAttributeInfo) attrInfo));
} else if (attrInfo instanceof AssociationAttributeInfo) {
AssociationAttributeInfo assocInfo = (AssociationAttributeInfo) attrInfo;
switch (assocInfo.getType()) {
case MANY_TO_ONE:
attributes.put(assocInfo.getName(), new ManyToOneAttribute());
break;
case ONE_TO_MANY:
OneToManyAttribute oneToMany = new OneToManyAttribute();
oneToMany.setValue(new ArrayList<AssociationValue>());
attributes.put(assocInfo.getName(), oneToMany);
break;
}
}
}