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


Java FilterExpression.accept方法代码示例

本文整理汇总了Java中org.apache.olingo.odata2.api.uri.expression.FilterExpression.accept方法的典型用法代码示例。如果您正苦于以下问题:Java FilterExpression.accept方法的具体用法?Java FilterExpression.accept怎么用?Java FilterExpression.accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.olingo.odata2.api.uri.expression.FilterExpression的用法示例。


在下文中一共展示了FilterExpression.accept方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProducts

import org.apache.olingo.odata2.api.uri.expression.FilterExpression; //导入方法依赖的package包/类
public List<Product> getProducts(User user, String uuid,
      FilterExpression filter_expr, OrderByExpression order_expr, int skip,
      int top) throws ExceptionVisitExpression, ODataApplicationException
{
   ProductSQLVisitor expV = new ProductSQLVisitor();
   Object visit_result = null;

   if (filter_expr != null)
   {
      visit_result = filter_expr.accept(expV);
   }
   if (order_expr != null)
   {
      visit_result = order_expr.accept(expV);
   }

   return productService.getProducts((DetachedCriteria) visit_result, uuid,
         skip, top);
}
 
开发者ID:SentinelDataHub,项目名称:DataHubSystem,代码行数:20,代码来源:OlingoManager.java

示例2: getUsers

import org.apache.olingo.odata2.api.uri.expression.FilterExpression; //导入方法依赖的package包/类
public List<User> getUsers(
      FilterExpression filter_expr, OrderByExpression order_expr, int skip,
      int top) throws ExceptionVisitExpression, ODataApplicationException
{
   UserSQLVisitor expV = new UserSQLVisitor();
   Object visit = null;
   if (filter_expr != null)
   {
      visit = filter_expr.accept(expV);
   }
   if (order_expr != null)
   {
      visit = order_expr.accept(expV);
   }
   return userService.getUsers((DetachedCriteria) visit, skip, top);
}
 
开发者ID:SentinelDataHub,项目名称:DataHubSystem,代码行数:17,代码来源:OlingoManager.java

示例3: getProductsNumber

import org.apache.olingo.odata2.api.uri.expression.FilterExpression; //导入方法依赖的package包/类
public int getProductsNumber(String uuid, FilterExpression filter_expr)
         throws ExceptionVisitExpression, ODataApplicationException
{
   ProductSQLVisitor expV = new ProductSQLVisitor();
   Object visit = null;

   if (filter_expr != null)
   {
      visit = filter_expr.accept(expV);
   }

   return productService.countProducts((DetachedCriteria) visit, uuid);
}
 
开发者ID:SentinelDataHub,项目名称:DataHubSystem,代码行数:14,代码来源:OlingoManager.java

示例4: getUsersNumber

import org.apache.olingo.odata2.api.uri.expression.FilterExpression; //导入方法依赖的package包/类
public int getUsersNumber(FilterExpression filter_expr)
      throws ExceptionVisitExpression, ODataApplicationException
{
   UserSQLVisitor expV = new UserSQLVisitor();
   Object visit = null;
   if (filter_expr != null)
   {
      visit = filter_expr.accept(expV);
   }
   return userService.countUsers((DetachedCriteria) visit);
}
 
开发者ID:SentinelDataHub,项目名称:DataHubSystem,代码行数:12,代码来源:OlingoManager.java

示例5: readEntitySet

import org.apache.olingo.odata2.api.uri.expression.FilterExpression; //导入方法依赖的package包/类
@Override
public ODataResponse readEntitySet(GetEntitySetUriInfo uriInfo, String contentType) throws ODataException
{
         int skip = getSkip(uriInfo);
         int top = getTop(uriInfo);

         if (uriInfo.getNavigationSegments().isEmpty()) {
           String queryString = "";
           IssueFilter issueFilter = new IssueFilter();

           FilterExpression filterExpression = uriInfo.getFilter();
           if (filterExpression != null) {
             queryString = (String) filterExpression.accept(issueFilter);
           }

           OrderByExpression orderByExpression = uriInfo.getOrderBy();
           if (orderByExpression != null) {
             queryString += (String) orderByExpression.accept(issueFilter);
           }

           // Parse and sanitize the query
           ParseResult parseResult = searchService.parseQuery(currentUser, queryString);
           if (parseResult.isValid()) {
             try {
               PagerFilter<Issue> pagerFilter = null;
               if (top > 0 && skip == 0) {
                 pagerFilter = new PagerFilter<Issue>(top);
               } else if (top > 0 && skip > 0) {
                 pagerFilter = new PagerFilter<Issue>(skip, top);
               } else {
                 pagerFilter = PagerFilter.getUnlimitedFilter();
               }

               SearchResults searchResults = searchService.search(currentUser, parseResult.getQuery(), pagerFilter);
               List<Issue> issues = searchResults.getIssues();

               List<ODataIssue> odataIssues = new ArrayList<ODataIssue>();
               for (Issue issue : issues) {
                 if (issueFilter.postFilter(issue.getKey().toLowerCase())) {                    
                   odataIssues.add(new ODataIssue(issue, serviceRoot));
                 }
               }

               return EntityProvider.writeFeed(contentType, uriInfo.getTargetEntitySet(), getODataList(odataIssues), propertiesBuilder.build());

             } catch (SearchException e) {
               throw new ODataException(e.getMessage());
             }
           }
         }
    
         throw new ODataNotImplementedException();
}
 
开发者ID:SAP,项目名称:SAPJamWorkPatternJIRAIntegration,代码行数:54,代码来源:IssueProcessor.java

示例6: toJson

import org.apache.olingo.odata2.api.uri.expression.FilterExpression; //导入方法依赖的package包/类
private static String toJson(final FilterExpression expression) throws ExceptionVisitExpression,
    ODataApplicationException {
  return (String) expression.accept(new JsonVisitor());
}
 
开发者ID:apache,项目名称:olingo-odata2,代码行数:5,代码来源:FilterToJsonTest.java


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