private UriResource count(final UriResource previous) throws UriParserException { ParserHelper.requireTokenEnd(tokenizer); requireTyped(previous, "$count"); if (((UriResourcePartTyped) previous).isCollection()) { return new UriResourceCountImpl(); } else { throw new UriParserSemanticException("$count is only allowed on collections.", UriParserSemanticException.MessageKeys.ONLY_FOR_COLLECTIONS, "$count"); } }
private UriResource count(final UriResource previous) throws UriParserException { ParserHelper.requireTokenEnd(tokenizer); requireTyped(previous, "$count"); if (((UriResourcePartTyped) previous).isCollection()) { return new UriResourceCountImpl(); } else { throw new UriParserSemanticException("$count is only allowed on collections.", UriParserSemanticException.MessageKeys.ONLY_FOR_COLLECTIONS, "$count"); } }
private void parseCollectionPathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource) throws UriParserException, UriValidationException { // The initial slash (see grammar) must have been checked and consumed by the caller. if (tokenizer.next(TokenKind.COUNT)) { uriInfo.addResourcePart(new UriResourceCountImpl()); } else if (tokenizer.next(TokenKind.ANY)) { uriInfo.addResourcePart(parseLambdaRest(TokenKind.ANY, lastResource)); } else if (tokenizer.next(TokenKind.ALL)) { uriInfo.addResourcePart(parseLambdaRest(TokenKind.ALL, lastResource)); } else if (tokenizer.next(TokenKind.QualifiedName)) { parseBoundFunction(new FullQualifiedName(tokenizer.getText()), uriInfo, lastResource); } else { throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX); } }
private void parseCollectionPathExpr(UriInfoImpl uriInfo, final UriResourcePartTyped lastResource) throws UriParserException, UriValidationException { // The initial slash (see grammar) must have been checked and consumed by the caller. if (tokenizer.next(TokenKind.COUNT)) { uriInfo.addResourcePart(new UriResourceCountImpl()); } else if (tokenizer.next(TokenKind.ANY)) { uriInfo.addResourcePart(parseLambdaRest(TokenKind.ANY, lastResource)); } else if (tokenizer.next(TokenKind.ALL)) { uriInfo.addResourcePart(parseLambdaRest(TokenKind.ALL, lastResource)); } else if (tokenizer.next(TokenKind.QualifiedName)) { parseBoundFunction(new FullQualifiedName(tokenizer.getText()), uriInfo, lastResource); } else { throw new UriParserSyntaxException("Unexpected token.", UriParserSyntaxException.MessageKeys.SYNTAX); } }
} else { ParserHelper.requireNext(tokenizer, TokenKind.COUNT); resource.addResourcePart(new UriResourceCountImpl()); item.setCountPath(true); parseOptions(tokenizer, newReferencedType, newReferencedIsCollection, item, false, true);
} else { ParserHelper.requireNext(tokenizer, TokenKind.COUNT); resource.addResourcePart(new UriResourceCountImpl()); item.setCountPath(true); parseOptions(tokenizer, newReferencedType, newReferencedIsCollection, item, false, true);
ParserHelper.requireNext(tokenizer, TokenKind.CLOSE); } else if (tokenizer.next(TokenKind.COUNT)) { uriInfo.addResourcePart(new UriResourceCountImpl()); aggregateExpression.setPath(uriInfo); final String alias = parseAsAlias(referencedType, true);
ParserHelper.requireNext(tokenizer, TokenKind.CLOSE); } else if (tokenizer.next(TokenKind.COUNT)) { uriInfo.addResourcePart(new UriResourceCountImpl()); aggregateExpression.setPath(uriInfo); final String alias = parseAsAlias(referencedType, true);