switch (property.getType().getKind()) {
case SIMPLE:
case COMPLEX:
if (keyPredicateName != null || emptyParentheses != null) {
throw new UriSyntaxException(UriSyntaxException.INVALIDSEGMENT.addContent(currentPathSegment));
}
if (uriResult.isLinks()) {
throw new UriSyntaxException(UriSyntaxException.NONAVIGATIONPROPERTY.addContent(property));
}
handlePropertyPath((EdmProperty) property);
break;
case ENTITY: // navigation properties point to entities
final EdmNavigationProperty navigationProperty = (EdmNavigationProperty) property;
if (keyPredicateName != null || emptyParentheses != null) {
if (navigationProperty.getMultiplicity() != EdmMultiplicity.MANY) {
throw new UriSyntaxException(UriSyntaxException.INVALIDSEGMENT.addContent(currentPathSegment));
}
}
addNavigationSegment(keyPredicateName, navigationProperty);
boolean many = false;
if (navigationProperty.getMultiplicity() == EdmMultiplicity.MANY) {
many = keyPredicateName == null;
}
if (pathSegments.isEmpty()) {
if (many) {
if (uriResult.isLinks()) {
uriResult.setUriType(UriType.URI7B);
} else {
uriResult.setUriType(UriType.URI6B);
}
} else if (uriResult.isLinks()) {
uriResult.setUriType(UriType.URI7A);
} else {
uriResult.setUriType(UriType.URI6A);
}
} else if (many || uriResult.isLinks()) {
currentPathSegment = pathSegments.remove(0);
checkCount();
if (!uriResult.isCount()) {
throw new UriSyntaxException(UriSyntaxException.INVALIDSEGMENT.addContent(currentPathSegment));
}
if (many) {
if (uriResult.isLinks()) {
uriResult.setUriType(UriType.URI50B);
} else {
uriResult.setUriType(UriType.URI15);
}
} else {
uriResult.setUriType(UriType.URI50A);
}
} else {
handleNavigationPathOptions();
}
break;
default:
throw new UriSyntaxException(UriSyntaxException.INVALIDPROPERTYTYPE.addContent(property.getType().getKind()));
}
}