final String containerName = referencedEntityName.substring(0, containerSeparator); referencedEntityName = referencedEntityName.substring(containerSeparator + 1); entityContainer = edm.getEntityContainer(containerName); if (entityContainer == null) { throw new IllegalArgumentException("EDM does not have entity container " + containerName);
final String containerName = referencedEntityName.substring(0, containerSeparator); referencedEntityName = referencedEntityName.substring(containerSeparator + 1); entityContainer = edm.getEntityContainer(containerName); if (entityContainer == null) { throw new IllegalArgumentException("EDM does not have entity container " + containerName);
private void handleNormalInitialSegment() throws UriSyntaxException, UriNotMatchingException, EdmException { final Matcher matcher = INITIAL_SEGMENT_PATTERN.matcher(currentPathSegment); if (!matcher.matches()) { throw new UriNotMatchingException(UriNotMatchingException.MATCHPROBLEM.addContent(currentPathSegment)); } final String entityContainerName = percentDecode(matcher.group(1)); final String segmentName = percentDecode(matcher.group(2)); final String keyPredicate = matcher.group(3); final String emptyParentheses = matcher.group(4); final EdmEntityContainer entityContainer = entityContainerName == null ? edm.getDefaultEntityContainer() : edm.getEntityContainer(entityContainerName); if (entityContainer == null) { throw new UriNotMatchingException(UriNotMatchingException.CONTAINERNOTFOUND.addContent(entityContainerName)); } uriResult.setEntityContainer(entityContainer); final EdmEntitySet entitySet = entityContainer.getEntitySet(segmentName); if (entitySet != null) { uriResult.setStartEntitySet(entitySet); handleEntitySet(entitySet, keyPredicate); } else { final EdmFunctionImport functionImport = entityContainer.getFunctionImport(segmentName); if (functionImport == null) { throw new UriNotMatchingException(UriNotMatchingException.NOTFOUND.addContent(segmentName)); } uriResult.setFunctionImport(functionImport); handleFunctionImport(functionImport, emptyParentheses, keyPredicate); } }
private void handleNormalInitialSegment() throws UriSyntaxException, UriNotMatchingException, EdmException { final Matcher matcher = INITIAL_SEGMENT_PATTERN.matcher(currentPathSegment); if (!matcher.matches()) { throw new UriNotMatchingException(UriNotMatchingException.MATCHPROBLEM.addContent(currentPathSegment)); } final String entityContainerName = percentDecode(matcher.group(1)); final String segmentName = percentDecode(matcher.group(2)); final String keyPredicate = matcher.group(3); final String emptyParentheses = matcher.group(4); final EdmEntityContainer entityContainer = entityContainerName == null ? edm.getDefaultEntityContainer() : edm.getEntityContainer(entityContainerName); if (entityContainer == null) { throw new UriNotMatchingException(UriNotMatchingException.CONTAINERNOTFOUND.addContent(entityContainerName)); } uriResult.setEntityContainer(entityContainer); final EdmEntitySet entitySet = entityContainer.getEntitySet(segmentName); if (entitySet != null) { uriResult.setStartEntitySet(entitySet); handleEntitySet(entitySet, keyPredicate); } else { final EdmFunctionImport functionImport = entityContainer.getFunctionImport(segmentName); if (functionImport == null) { throw new UriNotMatchingException(UriNotMatchingException.NOTFOUND.addContent(segmentName)); } uriResult.setFunctionImport(functionImport); handleFunctionImport(functionImport, emptyParentheses, keyPredicate); } }
private void handleNormalInitialSegment() throws UriSyntaxException, UriNotMatchingException, EdmException { final Matcher matcher = INITIAL_SEGMENT_PATTERN.matcher(currentPathSegment); if (!matcher.matches()) { throw new UriNotMatchingException(UriNotMatchingException.MATCHPROBLEM.addContent(currentPathSegment)); } final String entityContainerName = percentDecode(matcher.group(1)); final String segmentName = percentDecode(matcher.group(2)); final String keyPredicate = matcher.group(3); final String emptyParentheses = matcher.group(4); final EdmEntityContainer entityContainer = entityContainerName == null ? edm.getDefaultEntityContainer() : edm.getEntityContainer(entityContainerName); if (entityContainer == null) { throw new UriNotMatchingException(UriNotMatchingException.CONTAINERNOTFOUND.addContent(entityContainerName)); } uriResult.setEntityContainer(entityContainer); final EdmEntitySet entitySet = entityContainer.getEntitySet(segmentName); if (entitySet != null) { uriResult.setStartEntitySet(entitySet); handleEntitySet(entitySet, keyPredicate); } else { final EdmFunctionImport functionImport = entityContainer.getFunctionImport(segmentName); if (functionImport == null) { throw new UriNotMatchingException(UriNotMatchingException.NOTFOUND.addContent(segmentName)); } uriResult.setFunctionImport(functionImport); handleFunctionImport(functionImport, emptyParentheses, keyPredicate); } }