if (featureInfo.getIdentifier().getName().equals(name)) {
try {
return dtoConverterService.toDto(entity == null ? null : entity.getAttribute(name),
featureInfo.getIdentifier());
} catch (GeomajasException e) {
throw new LayerException(e, ExceptionCode.CONVERSION_PROBLEM);
}
}
for (AttributeInfo attributeInfo : featureInfo.getAttributes()) {
names.add(attributeInfo.getName());
if (attributeInfo.getName().equals(name)) {
if (attributeInfo instanceof AssociationAttributeInfo) {
associationAttributeInfo = (AssociationAttributeInfo) attributeInfo;
} else if (attributeInfo instanceof PrimitiveAttributeInfo) {
// primitive, return the attribute
PrimitiveAttributeInfo primitiveAttributeInfo = (PrimitiveAttributeInfo) attributeInfo;
try {
return dtoConverterService.toDto(entity == null ? null : entity.getAttribute(name),
primitiveAttributeInfo);
} catch (GeomajasException e) {
throw new LayerException(e, ExceptionCode.CONVERSION_PROBLEM);
}
}
}
}
// association attribute
if (associationAttributeInfo == null) {
throw new LayerException(ExceptionCode.ATTRIBUTE_UNKNOWN, name, names);
} else if (path.length > 1) {
// go deeper
return getRecursiveAttribute(entity == null ? null : entity.getChild(name),
associationAttributeInfo.getFeature(), Arrays.copyOfRange(path, 1, path.length));
} else {