private void handleResourcePath() throws UriSyntaxException, UriNotMatchingException, EdmException { if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI0); } else { currentPathSegment = pathSegments.remove(0); if ("$metadata".equals(currentPathSegment)) { ensureLastSegment(); uriResult.setUriType(UriType.URI8); } else if ("$batch".equals(currentPathSegment)) { ensureLastSegment(); uriResult.setUriType(UriType.URI9); } else { handleNormalInitialSegment(); } } }
private void handleResourcePath() throws UriSyntaxException, UriNotMatchingException, EdmException { if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI0); } else { currentPathSegment = pathSegments.remove(0); final String decodedPath = percentDecode(currentPathSegment); if ("$metadata".equals(decodedPath)) { ensureLastSegment(); uriResult.setUriType(UriType.URI8); } else if ("$batch".equals(decodedPath)) { ensureLastSegment(); uriResult.setUriType(UriType.URI9); } else { handleNormalInitialSegment(); } } }
private void handleResourcePath() throws UriSyntaxException, UriNotMatchingException, EdmException { if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI0); } else { currentPathSegment = pathSegments.remove(0); final String decodedPath = percentDecode(currentPathSegment); if ("$metadata".equals(decodedPath)) { ensureLastSegment(); uriResult.setUriType(UriType.URI8); } else if ("$batch".equals(decodedPath)) { ensureLastSegment(); uriResult.setUriType(UriType.URI9); } else { handleNormalInitialSegment(); } } }
private void handleEntitySet(final EdmEntitySet entitySet, final String keyPredicate) throws UriSyntaxException, UriNotMatchingException, EdmException { final EdmEntityType entityType = entitySet.getEntityType(); uriResult.setTargetType(entityType); uriResult.setTargetEntitySet(entitySet); if (keyPredicate == null) { if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI1); } else { currentPathSegment = pathSegments.remove(0); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI15); } else { throw new UriSyntaxException(UriSyntaxException.ENTITYSETINSTEADOFENTITY.addContent(entitySet.getName())); } } } else { uriResult.setKeyPredicates(parseKey(keyPredicate, entityType)); if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI2); } else { handleNavigationPathOptions(); } } }
private void handleEntitySet(final EdmEntitySet entitySet, final String keyPredicate) throws UriSyntaxException, UriNotMatchingException, EdmException { final EdmEntityType entityType = entitySet.getEntityType(); uriResult.setTargetType(entityType); uriResult.setTargetEntitySet(entitySet); if (keyPredicate == null) { if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI1); } else { currentPathSegment = pathSegments.remove(0); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI15); } else { throw new UriSyntaxException(UriSyntaxException.ENTITYSETINSTEADOFENTITY.addContent(entitySet.getName())); } } } else { uriResult.setKeyPredicates(parseKey(keyPredicate, entityType)); if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI2); } else { handleNavigationPathOptions(); } } }
private void handleEntitySet(final EdmEntitySet entitySet, final String keyPredicate) throws UriSyntaxException, UriNotMatchingException, EdmException { final EdmEntityType entityType = entitySet.getEntityType(); uriResult.setTargetType(entityType); uriResult.setTargetEntitySet(entitySet); if (keyPredicate == null) { if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI1); } else { currentPathSegment = pathSegments.remove(0); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI15); } else { throw new UriSyntaxException(UriSyntaxException.ENTITYSETINSTEADOFENTITY.addContent(entitySet.getName())); } } } else { uriResult.setKeyPredicates(parseKey(keyPredicate, entityType)); if (pathSegments.isEmpty()) { uriResult.setUriType(UriType.URI2); } else { handleNavigationPathOptions(); } } }
private void handleNavigationPathOptions() throws UriSyntaxException, UriNotMatchingException, EdmException { currentPathSegment = pathSegments.remove(0); final String decodedPath = percentDecode(currentPathSegment); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI16); // Count of multiple entities is handled elsewhere } else if ("$value".equals(decodedPath)) { if (uriResult.getTargetEntitySet().getEntityType().hasStream()) { ensureLastSegment(); uriResult.setUriType(UriType.URI17); uriResult.setValue(true); } else { throw new UriSyntaxException(UriSyntaxException.NOMEDIARESOURCE); } } else if ("$links".equals(decodedPath)) { uriResult.setLinks(true); if (pathSegments.isEmpty()) { throw new UriSyntaxException(UriSyntaxException.MUSTNOTBELASTSEGMENT.addContent(currentPathSegment)); } currentPathSegment = pathSegments.remove(0); handleNavigationProperties(); } else { handleNavigationProperties(); } }
private void handleNavigationPathOptions() throws UriSyntaxException, UriNotMatchingException, EdmException { currentPathSegment = pathSegments.remove(0); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI16); // Count of multiple entities is handled elsewhere } else if ("$value".equals(currentPathSegment)) { if (uriResult.getTargetEntitySet().getEntityType().hasStream()) { ensureLastSegment(); uriResult.setUriType(UriType.URI17); uriResult.setValue(true); } else { throw new UriSyntaxException(UriSyntaxException.NOMEDIARESOURCE); } } else if ("$links".equals(currentPathSegment)) { uriResult.setLinks(true); if (pathSegments.isEmpty()) { throw new UriSyntaxException(UriSyntaxException.MUSTNOTBELASTSEGMENT.addContent(currentPathSegment)); } currentPathSegment = pathSegments.remove(0); handleNavigationProperties(); } else { handleNavigationProperties(); } }
private void handleNavigationPathOptions() throws UriSyntaxException, UriNotMatchingException, EdmException { currentPathSegment = pathSegments.remove(0); final String decodedPath = percentDecode(currentPathSegment); checkCount(); if (uriResult.isCount()) { uriResult.setUriType(UriType.URI16); // Count of multiple entities is handled elsewhere } else if ("$value".equals(decodedPath)) { if (uriResult.getTargetEntitySet().getEntityType().hasStream()) { ensureLastSegment(); uriResult.setUriType(UriType.URI17); uriResult.setValue(true); } else { throw new UriSyntaxException(UriSyntaxException.NOMEDIARESOURCE); } } else if ("$links".equals(decodedPath)) { uriResult.setLinks(true); if (pathSegments.isEmpty()) { throw new UriSyntaxException(UriSyntaxException.MUSTNOTBELASTSEGMENT.addContent(currentPathSegment)); } currentPathSegment = pathSegments.remove(0); handleNavigationProperties(); } else { handleNavigationProperties(); } }
if (type.getKind() == EdmTypeKind.SIMPLE) { if (uriResult.getPropertyPath().size() == 1) { uriResult.setUriType(UriType.URI5); } else { uriResult.setUriType(UriType.URI4); uriResult.setUriType(UriType.URI3); } else { throw new UriSyntaxException(UriSyntaxException.INVALIDPROPERTYTYPE.addContent(type.getKind())); uriResult.setValue(true); if (uriResult.getPropertyPath().size() == 1) { uriResult.setUriType(UriType.URI5); } else { uriResult.setUriType(UriType.URI4);
if (type.getKind() == EdmTypeKind.SIMPLE) { if (uriResult.getPropertyPath().size() == 1) { uriResult.setUriType(UriType.URI5); } else { uriResult.setUriType(UriType.URI4); uriResult.setUriType(UriType.URI3); } else { throw new UriSyntaxException(UriSyntaxException.INVALIDPROPERTYTYPE.addContent(type.getKind())); uriResult.setValue(true); if (uriResult.getPropertyPath().size() == 1) { uriResult.setUriType(UriType.URI5); } else { uriResult.setUriType(UriType.URI4);
if (type.getKind() == EdmTypeKind.SIMPLE) { if (uriResult.getPropertyPath().size() == 1) { uriResult.setUriType(UriType.URI5); } else { uriResult.setUriType(UriType.URI4); uriResult.setUriType(UriType.URI3); } else { throw new UriSyntaxException(UriSyntaxException.INVALIDPROPERTYTYPE.addContent(type.getKind())); uriResult.setValue(true); if (uriResult.getPropertyPath().size() == 1) { uriResult.setUriType(UriType.URI5); } else { uriResult.setUriType(UriType.URI4);
switch (type.getKind()) { case SIMPLE: uriResult.setUriType(isCollection ? UriType.URI13 : UriType.URI14); break; case COMPLEX: uriResult.setUriType(isCollection ? UriType.URI11 : UriType.URI12); break; case ENTITY: uriResult.setUriType(UriType.URI10); break; default: uriResult.setUriType(UriType.URI14);
switch (type.getKind()) { case SIMPLE: uriResult.setUriType(isCollection ? UriType.URI13 : UriType.URI14); break; case COMPLEX: uriResult.setUriType(isCollection ? UriType.URI11 : UriType.URI12); break; case ENTITY: uriResult.setUriType(UriType.URI10); break; default:
if (many) { if (uriResult.isLinks()) { uriResult.setUriType(UriType.URI7B); } else { uriResult.setUriType(UriType.URI6B); uriResult.setUriType(UriType.URI7A); } else { uriResult.setUriType(UriType.URI6A); uriResult.setUriType(UriType.URI50B); } else { uriResult.setUriType(UriType.URI15); uriResult.setUriType(UriType.URI50A);
if (many) { if (uriResult.isLinks()) { uriResult.setUriType(UriType.URI7B); } else { uriResult.setUriType(UriType.URI6B); uriResult.setUriType(UriType.URI7A); } else { uriResult.setUriType(UriType.URI6A); uriResult.setUriType(UriType.URI50B); } else { uriResult.setUriType(UriType.URI15); uriResult.setUriType(UriType.URI50A);
if (many) { if (uriResult.isLinks()) { uriResult.setUriType(UriType.URI7B); } else { uriResult.setUriType(UriType.URI6B); uriResult.setUriType(UriType.URI7A); } else { uriResult.setUriType(UriType.URI6A); uriResult.setUriType(UriType.URI50B); } else { uriResult.setUriType(UriType.URI15); uriResult.setUriType(UriType.URI50A);
switch (type.getKind()) { case SIMPLE: uriResult.setUriType(isCollection ? UriType.URI13 : UriType.URI14); break; case COMPLEX: uriResult.setUriType(isCollection ? UriType.URI11 : UriType.URI12); break; case ENTITY: uriResult.setUriType(UriType.URI10); break; default: