private void parseFilterOption(FilterOption filterOption, final EdmType contextType, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (filterOption != null) { final String optionValue = filterOption.getText(); UriTokenizer filterTokenizer = new UriTokenizer(optionValue); // The referring type could be a primitive type or a structured type. ((FilterOptionImpl) filterOption).setExpression( new FilterParser(edm, odata).parse(filterTokenizer, contextType, entitySetNames, aliases) .getExpression()); checkOptionEOF(filterTokenizer, filterOption.getName(), optionValue); } }
private void parseSelectOption(SelectOption selectOption, final EdmType contextType, final boolean contextIsCollection) throws UriParserException, UriValidationException { if (selectOption != null) { final String optionValue = selectOption.getText(); UriTokenizer selectTokenizer = new UriTokenizer(optionValue); ((SelectOptionImpl) selectOption).setSelectItems( new SelectParser(edm).parse(selectTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null, contextIsCollection) .getSelectItems()); checkOptionEOF(selectTokenizer, selectOption.getName(), optionValue); } }
private void parseFilterOption(FilterOption filterOption, final EdmType contextType, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (filterOption != null) { final String optionValue = filterOption.getText(); UriTokenizer filterTokenizer = new UriTokenizer(optionValue); // The referring type could be a primitive type or a structured type. ((FilterOptionImpl) filterOption).setExpression( new FilterParser(edm, odata).parse(filterTokenizer, contextType, entitySetNames, aliases) .getExpression()); checkOptionEOF(filterTokenizer, filterOption.getName(), optionValue); } }
private void parseSelectOption(SelectOption selectOption, final EdmType contextType, final boolean contextIsCollection) throws UriParserException, UriValidationException { if (selectOption != null) { final String optionValue = selectOption.getText(); UriTokenizer selectTokenizer = new UriTokenizer(optionValue); ((SelectOptionImpl) selectOption).setSelectItems( new SelectParser(edm).parse(selectTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null, contextIsCollection) .getSelectItems()); checkOptionEOF(selectTokenizer, selectOption.getName(), optionValue); } }
private void parseExpandOption(ExpandOption expandOption, final EdmType contextType, final boolean isAll, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (expandOption != null) { if (!(contextType instanceof EdmStructuredType || isAll || (entitySetNames != null && !entitySetNames.isEmpty()))) { throw new UriValidationException("Expand is only allowed on structured types!", UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED, expandOption.getName()); } final String optionValue = expandOption.getText(); UriTokenizer expandTokenizer = new UriTokenizer(optionValue); final ExpandOption option = new ExpandParser(edm, odata, aliases, entitySetNames).parse(expandTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null); checkOptionEOF(expandTokenizer, expandOption.getName(), optionValue); for (final ExpandItem item : option.getExpandItems()) { ((ExpandOptionImpl) expandOption).addExpandItem(item); } } }
private void parseOrderByOption(OrderByOption orderByOption, final EdmType contextType, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (orderByOption != null) { final String optionValue = orderByOption.getText(); UriTokenizer orderByTokenizer = new UriTokenizer(optionValue); final OrderByOption option = new OrderByParser(edm, odata).parse(orderByTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null, entitySetNames, aliases); checkOptionEOF(orderByTokenizer, orderByOption.getName(), optionValue); for (final OrderByItem item : option.getOrders()) { ((OrderByOptionImpl) orderByOption).addOrder(item); } } }
private void parseExpandOption(ExpandOption expandOption, final EdmType contextType, final boolean isAll, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (expandOption != null) { if (!(contextType instanceof EdmStructuredType || isAll || (entitySetNames != null && !entitySetNames.isEmpty()))) { throw new UriValidationException("Expand is only allowed on structured types!", UriValidationException.MessageKeys.SYSTEM_QUERY_OPTION_NOT_ALLOWED, expandOption.getName()); } final String optionValue = expandOption.getText(); UriTokenizer expandTokenizer = new UriTokenizer(optionValue); final ExpandOption option = new ExpandParser(edm, odata, aliases, entitySetNames).parse(expandTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null); checkOptionEOF(expandTokenizer, expandOption.getName(), optionValue); for (final ExpandItem item : option.getExpandItems()) { ((ExpandOptionImpl) expandOption).addExpandItem(item); } } }
private void parseApplyOption(ApplyOption applyOption, EdmType contextType, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (applyOption != null) { final String optionValue = applyOption.getText(); UriTokenizer applyTokenizer = new UriTokenizer(optionValue); final ApplyOption option = new ApplyParser(edm, odata).parse(applyTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null, entitySetNames, aliases); checkOptionEOF(applyTokenizer, applyOption.getName(), optionValue); for (final ApplyItem item : option.getApplyItems()) { ((ApplyOptionImpl) applyOption).add(item); } } }
private void parseOrderByOption(OrderByOption orderByOption, final EdmType contextType, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (orderByOption != null) { final String optionValue = orderByOption.getText(); UriTokenizer orderByTokenizer = new UriTokenizer(optionValue); final OrderByOption option = new OrderByParser(edm, odata).parse(orderByTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null, entitySetNames, aliases); checkOptionEOF(orderByTokenizer, orderByOption.getName(), optionValue); for (final OrderByItem item : option.getOrders()) { ((OrderByOptionImpl) orderByOption).addOrder(item); } } }
private void parseApplyOption(ApplyOption applyOption, EdmType contextType, final List<String> entitySetNames, final Map<String, AliasQueryOption> aliases) throws UriParserException, UriValidationException { if (applyOption != null) { final String optionValue = applyOption.getText(); UriTokenizer applyTokenizer = new UriTokenizer(optionValue); final ApplyOption option = new ApplyParser(edm, odata).parse(applyTokenizer, contextType instanceof EdmStructuredType ? (EdmStructuredType) contextType : null, entitySetNames, aliases); checkOptionEOF(applyTokenizer, applyOption.getName(), optionValue); for (final ApplyItem item : option.getApplyItems()) { ((ApplyOptionImpl) applyOption).add(item); } } }