本文整理汇总了Java中org.odata4j.expression.OrderByExpression.Direction类的典型用法代码示例。如果您正苦于以下问题:Java Direction类的具体用法?Java Direction怎么用?Java Direction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Direction类属于org.odata4j.expression.OrderByExpression包,在下文中一共展示了Direction类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseOrderBy
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
/**
* orderbyのパース.
* @param value orderbyの値
* @return パース結果
*/
public static List<OrderByExpression> parseOrderBy(String value) {
List<Token> tokens = tokenize(value);
// dump(value,tokens,null);
List<CommonExpression> expressions = readExpressions(tokens);
if (ExpressionParser.DUMP_EXPRESSION_INFO) {
dump(value, tokens, Enumerable.create(expressions).toArray(CommonExpression.class));
}
return Enumerable.create(expressions).select(new Func1<CommonExpression, OrderByExpression>() {
public OrderByExpression apply(CommonExpression input) {
if (input instanceof OrderByExpression) {
return (OrderByExpression) input;
}
return Expression.orderBy(input, Direction.ASCENDING); // default to asc
}
}).toList();
}
示例2: parseOrderBy
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
public static List<OrderByExpression> parseOrderBy(String value) {
List<Token> tokens = tokenize(value);
// dump(value,tokens,null);
List<CommonExpression> expressions = readExpressions(tokens);
if (DUMP_EXPRESSION_INFO) {
dump(value, tokens, Enumerable.create(expressions).toArray(CommonExpression.class));
}
return Enumerable.create(expressions).select(new Func1<CommonExpression, OrderByExpression>() {
public OrderByExpression apply(CommonExpression input) {
if (input instanceof OrderByExpression) {
return (OrderByExpression) input;
}
return Expression.orderBy(input, Direction.ASCENDING); // default to asc
}
}).toList();
}
示例3: getOrderOption
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
/**
* $orderbyのオプションを取得する.
* @param option odata4jのオプション
* @return optionValue 取得したオプション
*/
public String getOrderOption(Direction option) {
String optionValue;
// デフォルト値は昇順(ASCENDING)
if (option == null || option.equals(Direction.ASCENDING)) {
optionValue = SORT_ASC;
} else {
optionValue = SORT_DESC;
}
return optionValue;
}
示例4: visit
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
@Override
public void visit(Direction direction) {
Expression expr = stack.pop();
if (expr instanceof CompareCriteria) {
expr = ((CompareCriteria)expr).getLeftExpression();
}
this.orderBy.addVariable(expr, direction == Direction.ASCENDING);
}
示例5: visit
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
@Override
public void visit(Direction direction) {
log.debug("visit(Direction direction)");
}
示例6: visit
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
@Override
public void visit(Direction direction) {
append(direction == Direction.ASCENDING ? "asc" : "desc");
}
示例7: visit
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
@Override
public void visit(Direction direction) {
}
示例8: visit
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
@Override
public void visit(Direction direction) {
throw new UnsupportedOperationException();
}
示例9: orderBy
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
public static OrderByExpression orderBy(final CommonExpression expression, final Direction direction) {
return new OrderByExpressionImpl(expression, direction);
}
示例10: OrderByExpressionImpl
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
protected OrderByExpressionImpl(CommonExpression expression, Direction direction) {
super(OrderByExpression.class, expression);
this.direction = direction;
}
示例11: getDirection
import org.odata4j.expression.OrderByExpression.Direction; //导入依赖的package包/类
@Override
public Direction getDirection() {
return direction;
}