private void handleLinks(final EdmEntityType entityType, final List<String> names,
final ExpandSelectTreeNodeImpl subNode) throws EdmException {
for (String navigationPropertyName : names) {
EdmTyped navigationProperty = entityType.getProperty(navigationPropertyName);
if (navigationProperty == null) {
throw new EdmException(EdmException.NAVIGATIONPROPERTYNOTFOUND.addContent(navigationPropertyName));
} else if (!(navigationProperty instanceof EdmNavigationProperty)) {
throw new EdmException(EdmException.MUSTBENAVIGATIONPROPERTY.addContent(navigationPropertyName));
}
putLink(navigationPropertyName, subNode);
}
}