private UriResourcePartTyped parseBoundOperation(UriTokenizer tokenizer, final FullQualifiedName qualifiedName, final EdmStructuredType referencedType, final boolean referencedIsCollection) throws UriParserException { final EdmAction boundAction = edm.getBoundAction(qualifiedName, referencedType.getFullQualifiedName(), referencedIsCollection); if (boundAction == null) { final List<String> parameterNames = parseFunctionParameterNames(tokenizer); final EdmFunction boundFunction = edm.getBoundFunction(qualifiedName, referencedType.getFullQualifiedName(), referencedIsCollection, parameterNames); if (boundFunction == null) { throw new UriParserSemanticException("Function not found.", UriParserSemanticException.MessageKeys.UNKNOWN_PART, qualifiedName.getFullQualifiedNameAsString()); } else { return new UriResourceFunctionImpl(null, boundFunction, null); } } else { return new UriResourceActionImpl(boundAction); } }
private UriResourcePartTyped parseBoundOperation(UriTokenizer tokenizer, final FullQualifiedName qualifiedName, final EdmStructuredType referencedType, final boolean referencedIsCollection) throws UriParserException { final EdmAction boundAction = edm.getBoundAction(qualifiedName, referencedType.getFullQualifiedName(), referencedIsCollection); if (boundAction == null) { final List<String> parameterNames = parseFunctionParameterNames(tokenizer); final EdmFunction boundFunction = edm.getBoundFunction(qualifiedName, referencedType.getFullQualifiedName(), referencedIsCollection, parameterNames); if (boundFunction == null) { throw new UriParserSemanticException("Function not found.", UriParserSemanticException.MessageKeys.UNKNOWN_PART, qualifiedName.getFullQualifiedNameAsString()); } else { return new UriResourceFunctionImpl(null, boundFunction, null); } } else { return new UriResourceActionImpl(boundAction); } }
if (edmActionImport != null) { ParserHelper.requireTokenEnd(tokenizer); return new UriResourceActionImpl(edmActionImport);
if (edmActionImport != null) { ParserHelper.requireTokenEnd(tokenizer); return new UriResourceActionImpl(edmActionImport);
private UriResource boundOperationOrTypeCast(UriResource previous) throws UriParserException, UriValidationException { final FullQualifiedName name = new FullQualifiedName(tokenizer.getText()); requireTyped(previous, name.getFullQualifiedNameAsString()); final UriResourcePartTyped previousTyped = (UriResourcePartTyped) previous; final EdmType previousTypeFilter = getPreviousTypeFilter(previousTyped); final EdmType previousType = previousTypeFilter == null ? previousTyped.getType() : previousTypeFilter; // We check for bound actions first because they cannot be followed by anything. final EdmAction boundAction = edm.getBoundAction(name, previousType.getFullQualifiedName(), previousTyped.isCollection()); if (boundAction != null) { ParserHelper.requireTokenEnd(tokenizer); return new UriResourceActionImpl(boundAction); } // Type casts can be syntactically indistinguishable from bound function calls in the case of additional keys. // But normally they are shorter, so they come next. final EdmStructuredType type = previousTyped.getType() instanceof EdmEntityType ? edm.getEntityType(name) : edm.getComplexType(name); if (type != null) { return typeCast(name, type, previousTyped); } if (tokenizer.next(TokenKind.EOF)) { throw new UriParserSemanticException("Type '" + name.getFullQualifiedNameAsString() + "' not found.", UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, name.getFullQualifiedNameAsString()); } // Now a bound function call is the only remaining option. return functionCall(null, name, previousType.getFullQualifiedName(), previousTyped.isCollection()); }
private UriResource boundOperationOrTypeCast(UriResource previous) throws UriParserException, UriValidationException { final FullQualifiedName name = new FullQualifiedName(tokenizer.getText()); requireTyped(previous, name.getFullQualifiedNameAsString()); final UriResourcePartTyped previousTyped = (UriResourcePartTyped) previous; final EdmType previousTypeFilter = getPreviousTypeFilter(previousTyped); final EdmType previousType = previousTypeFilter == null ? previousTyped.getType() : previousTypeFilter; // We check for bound actions first because they cannot be followed by anything. final EdmAction boundAction = edm.getBoundAction(name, previousType.getFullQualifiedName(), previousTyped.isCollection()); if (boundAction != null) { ParserHelper.requireTokenEnd(tokenizer); return new UriResourceActionImpl(boundAction); } // Type casts can be syntactically indistinguishable from bound function calls in the case of additional keys. // But normally they are shorter, so they come next. final EdmStructuredType type = previousTyped.getType() instanceof EdmEntityType ? edm.getEntityType(name) : edm.getComplexType(name); if (type != null) { return typeCast(name, type, previousTyped); } if (tokenizer.next(TokenKind.EOF)) { throw new UriParserSemanticException("Type '" + name.getFullQualifiedNameAsString() + "' not found.", UriParserSemanticException.MessageKeys.UNKNOWN_TYPE, name.getFullQualifiedNameAsString()); } // Now a bound function call is the only remaining option. return functionCall(null, name, previousType.getFullQualifiedName(), previousTyped.isCollection()); }