本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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();
}
示例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());
}