当前位置: 首页>>代码示例>>Java>>正文


Java SearchOption类代码示例

本文整理汇总了Java中org.apache.olingo.server.api.uri.queryoption.SearchOption的典型用法代码示例。如果您正苦于以下问题:Java SearchOption类的具体用法?Java SearchOption怎么用?Java SearchOption使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SearchOption类属于org.apache.olingo.server.api.uri.queryoption包,在下文中一共展示了SearchOption类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSearchQuery

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
/**
 * Method creates search query from $search system query option from URL.
 * 
 * @param uriInfo
 *            URI info
 * @return search query
 */
protected BoolQueryBuilder getSearchQuery(UriInfo uriInfo) {
    SearchOption searchOption = uriInfo.getSearchOption();
    ApplyOption applyOption = uriInfo.getApplyOption();
    BoolQueryBuilder searchQuery = new BoolQueryBuilder();
    if (searchOption != null) {
        buildSearchQuery(searchQuery, searchOption.getSearchExpression());
    } else if (applyOption != null) {
        List<SearchExpression> expressions = ApplyOptionUtils.getSearchItems(applyOption)
                .stream().map(e -> e.getSearchOption().getSearchExpression())
                .collect(Collectors.toList());
        for (SearchExpression expression : expressions) {
            buildSearchQuery(searchQuery, expression);
        }
    }
    return searchQuery;
}
 
开发者ID:Hevelian,项目名称:hevelian-olastic,代码行数:24,代码来源:RequestCreator.java

示例2: applySearchSystemQueryOption

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
public static void applySearchSystemQueryOption(final SearchOption searchOption, EntityCollection entitySet)
    throws ODataApplicationException {
  if (searchOption != null) {
    SearchExpression se = searchOption.getSearchExpression();
    Iterator<Entity> it = entitySet.getEntities().iterator();
    while (it.hasNext()) {
      boolean keep = false;
      Entity entity = it.next();
      ListIterator<Property> properties = entity.getProperties().listIterator();
      while (properties.hasNext() && !keep) {
        keep = isTrue(se, properties.next());
      }
      if (!keep) {
        it.remove();
      }
    }
  }
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:19,代码来源:SearchHandler.java

示例3: parse

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
public SearchOption parse(final String searchQuery) throws SearchParserException, SearchTokenizerException {
  SearchTokenizer tokenizer = new SearchTokenizer();
  SearchExpression searchExpression;
  try {
    searchExpression = parse(tokenizer.tokenize(searchQuery));
  } catch (SearchTokenizerException e) {
    String message = e.getMessage();
    throw new SearchParserException("Tokenizer exception with message: " + message, e,
        SearchParserException.MessageKeys.TOKENIZER_EXCEPTION, message);
  }
  final SearchOptionImpl searchOption = new SearchOptionImpl();
  searchOption.setSearchExpression(searchExpression);
  return searchOption;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:15,代码来源:SearchParser.java

示例4: resultsIn

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
private void resultsIn(final String expectedSearchExpression)
    throws SearchTokenizerException, SearchParserException {
  final SearchOption result = new SearchParser().parse(searchQuery);
  Assert.assertNotNull(result);
  final SearchExpression searchExpression = result.getSearchExpression();
  Assert.assertNotNull(searchExpression);
  Assert.assertEquals(expectedSearchExpression, searchExpression.toString());
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:9,代码来源:SearchParserAndTokenizerTest.java

示例5: visit

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
@Override
public void visit(SearchOption option) {
}
 
开发者ID:kenweezy,项目名称:teiid,代码行数:4,代码来源:DefaultODataResourceURLHierarchyVisitor.java

示例6: appendCommonJsonObjects

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
private void appendCommonJsonObjects(JsonGenerator gen,
    final CountOption countOption, final SkipOption skipOption, final TopOption topOption,
    final FilterOption filterOption, final OrderByOption orderByOption,
    final SelectOption selectOption, final ExpandOption expandOption, final SearchOption searchOption,
    final ApplyOption applyOption)
    throws IOException {
  if (countOption != null) {
    gen.writeBooleanField("isCount", countOption.getValue());
  }

  if (skipOption != null) {
    gen.writeNumberField("skip", skipOption.getValue());
  }

  if (topOption != null) {
    gen.writeNumberField("top", topOption.getValue());
  }

  if (filterOption != null) {
    gen.writeFieldName("filter");
    appendExpressionJson(gen, filterOption.getExpression());
  }

  if (orderByOption != null && !orderByOption.getOrders().isEmpty()) {
    gen.writeFieldName("orderby");
    gen.writeStartObject();
    gen.writeStringField("nodeType", "orderCollection");
    gen.writeFieldName("orders");
    appendOrderByItemsJson(gen, orderByOption.getOrders());
    gen.writeEndObject();
  }

  if (selectOption != null && !selectOption.getSelectItems().isEmpty()) {
    gen.writeFieldName("select");
    appendSelectedPropertiesJson(gen, selectOption.getSelectItems());
  }

  if (expandOption != null && !expandOption.getExpandItems().isEmpty()) {
    gen.writeFieldName("expand");
    appendExpandedPropertiesJson(gen, expandOption.getExpandItems());
  }

  if (searchOption != null) {
    gen.writeFieldName("search");
    appendSearchJson(gen, searchOption.getSearchExpression());
  }

  if (applyOption != null) {
    gen.writeFieldName("apply");
    appendApplyItemsJson(gen, applyOption.getApplyItems());
  }
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:53,代码来源:DebugTabUri.java

示例7: parse

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
public SearchOption parse(UriTokenizer tokenizer) throws SearchParserException {
  SearchOptionImpl searchOption = new SearchOptionImpl();
  searchOption.setSearchExpression(processExprOr(tokenizer));
  return searchOption;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:6,代码来源:SearchParser.java

示例8: parseTrafo

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
private ApplyItem parseTrafo(EdmStructuredType referencedType) throws UriParserException, UriValidationException {
  if (tokenizer.next(TokenKind.AggregateTrafo)) {
    return parseAggregateTrafo(referencedType);

  } else if (tokenizer.next(TokenKind.IDENTITY)) {
    return new IdentityImpl();

  } else if (tokenizer.next(TokenKind.ComputeTrafo)) {
    return parseComputeTrafo(referencedType);

  } else if (tokenizer.next(TokenKind.ConcatMethod)) {
    return parseConcatTrafo(referencedType);

  } else if (tokenizer.next(TokenKind.ExpandTrafo)) {
    return new ExpandImpl().setExpandOption(parseExpandTrafo(referencedType));

  } else if (tokenizer.next(TokenKind.FilterTrafo)) {
    final FilterOption filterOption = new FilterParser(edm, odata)
        .parse(tokenizer, referencedType, crossjoinEntitySetNames, aliases);
    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
    return new FilterImpl().setFilterOption(filterOption);

  } else if (tokenizer.next(TokenKind.GroupByTrafo)) {
    return parseGroupByTrafo(referencedType);

  } else if (tokenizer.next(TokenKind.SearchTrafo)) {
    final SearchOption searchOption = new SearchParser().parse(tokenizer);
    ParserHelper.requireNext(tokenizer, TokenKind.CLOSE);
    return new SearchImpl().setSearchOption(searchOption);

  } else if (tokenizer.next(TokenKind.QualifiedName)) {
    return parseCustomFunction(new FullQualifiedName(tokenizer.getText()), referencedType);

  } else {
    final TokenKind kind = ParserHelper.next(tokenizer,
        TokenKind.BottomCountTrafo, TokenKind.BottomPercentTrafo, TokenKind.BottomSumTrafo,
        TokenKind.TopCountTrafo, TokenKind.TopPercentTrafo, TokenKind.TopSumTrafo);
    if (kind == null) {
      throw new UriParserSyntaxException("Invalid apply expression syntax.",
          UriParserSyntaxException.MessageKeys.SYNTAX);
    } else {
      return parseBottomTop(kind, referencedType);
    }
  }
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:46,代码来源:ApplyParser.java

示例9: getSearchOption

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
@Override
public SearchOption getSearchOption() {
  return searchOption;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:5,代码来源:SearchImpl.java

示例10: setSearchOption

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
public SearchImpl setSearchOption(final SearchOption searchOption) {
  this.searchOption = searchOption;
  return this;
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:5,代码来源:SearchImpl.java

示例11: getSearchOption

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
@Override
public SearchOption getSearchOption() {
  return (SearchOption) systemQueryOptions.get(SystemQueryOptionKind.SEARCH);
}
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:5,代码来源:UriInfoImpl.java

示例12: getSearchOption

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
/**
 * Gets the search option.
 * @return a {@link SearchOption} (but never <code>null</code>)
 */
SearchOption getSearchOption();
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:6,代码来源:Search.java

示例13: getSearchOption

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
/**
 * @return Object containing information of the $search option
 */
SearchOption getSearchOption();
 
开发者ID:apache,项目名称:olingo-odata4,代码行数:5,代码来源:UriInfoResource.java

示例14: visit

import org.apache.olingo.server.api.uri.queryoption.SearchOption; //导入依赖的package包/类
void visit(SearchOption option); 
开发者ID:kenweezy,项目名称:teiid,代码行数:2,代码来源:ODataResourceURLVisitor.java


注:本文中的org.apache.olingo.server.api.uri.queryoption.SearchOption类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。