/** * Gets feed attribute. * * @param index index * @param field field * @return attribute or <code>null</code> if not available */ protected IFeedAttribute getFeedAttribute(Map<String, IFeedAttribute> index, DcatField field) { for (List<String> additives : field.getIndex()) { List<IFeedAttribute> lstAttributes = new ArrayList<IFeedAttribute>(); for (String indexName : additives) { IFeedAttribute attr = index.get(indexName); if (attr != null && !attr.isEmpty()) { lstAttributes.add(attr); } } if (lstAttributes.size() == 1) return lstAttributes.get(0); if (lstAttributes.size() > 1) return IFeedAttribute.Factory.createSum(lstAttributes, field.getJoinOperator()); } return null; }