本文整理汇总了Java中org.apache.olingo.server.api.uri.queryoption.expression.Method类的典型用法代码示例。如果您正苦于以下问题:Java Method类的具体用法?Java Method怎么用?Java Method使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Method类属于org.apache.olingo.server.api.uri.queryoption.expression包,在下文中一共展示了Method类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: accept
import org.apache.olingo.server.api.uri.queryoption.expression.Method; //导入依赖的package包/类
public void accept(Expression expr) {
if (expr instanceof Alias) {
visit((Alias) expr);
} else if (expr instanceof Binary) {
visit((Binary) expr);
} else if (expr instanceof Enumeration) {
visit((Enumeration) expr);
} else if (expr instanceof LambdaRef) {
visit((LambdaRef) expr);
} else if (expr instanceof Literal) {
visit((Literal) expr);
} else if (expr instanceof Member) {
visit((Member) expr);
} else if (expr instanceof Method) {
visit((Method) expr);
} else if (expr instanceof TypeLiteral) {
visit((TypeLiteral) expr);
} else if (expr instanceof Unary) {
visit((Unary) expr);
}
}
示例2: isType
import org.apache.olingo.server.api.uri.queryoption.expression.Method; //导入依赖的package包/类
public FilterValidator isType(final FullQualifiedName fullName) {
EdmType actualType = null;
if (curExpression instanceof Member) {
actualType = ((Member) curExpression).getType();
} else if (curExpression instanceof TypeLiteral) {
actualType = ((TypeLiteral) curExpression).getType();
} else if (curExpression instanceof Literal) {
actualType = ((Literal) curExpression).getType();
} else if (curExpression instanceof Enumeration) {
actualType = ((Enumeration) curExpression).getType();
} else if (curExpression instanceof Unary) {
actualType = ((UnaryImpl) curExpression).getType();
} else if (curExpression instanceof Binary) {
actualType = ((BinaryImpl) curExpression).getType();
} else if (curExpression instanceof Method) {
actualType = ((MethodImpl) curExpression).getType();
}
assertNotNull("Current expression not typed", actualType);
assertEquals(fullName, actualType.getFullQualifiedName());
return this;
}
示例3: setPath
import org.apache.olingo.server.api.uri.queryoption.expression.Method; //导入依赖的package包/类
private void setPath(Expression expression) {
if (expression instanceof Member) {
setPath((Member) expression);
} else if (expression instanceof Binary) {
Binary binaryExpression = (Binary) expression;
setPath(binaryExpression.getLeftOperand());
setPath(binaryExpression.getRightOperand());
} else if (expression instanceof Method) {
Method method = (Method) expression;
method.getParameters().forEach(this::setPath);
}
}
示例4: isMethod
import org.apache.olingo.server.api.uri.queryoption.expression.Method; //导入依赖的package包/类
public FilterValidator isMethod(final MethodKind methodKind, final int parameterCount) {
assertTrue("Current expression is not a methodCall", curExpression instanceof Method);
Method methodCall = (Method) curExpression;
assertEquals(methodKind, methodCall.getMethod());
assertEquals(parameterCount, methodCall.getParameters().size());
return this;
}
示例5: getType
import org.apache.olingo.server.api.uri.queryoption.expression.Method; //导入依赖的package包/类
protected static EdmType getType(final Expression expression) throws UriParserException {
EdmType type;
if (expression instanceof Literal) {
type = ((Literal) expression).getType();
} else if (expression instanceof TypeLiteral) {
type = ((TypeLiteral) expression).getType();
} else if (expression instanceof Enumeration) {
type = ((Enumeration) expression).getType();
} else if (expression instanceof Member) {
type = ((Member) expression).getType();
} else if (expression instanceof Unary) {
type = ((UnaryImpl) expression).getType();
} else if (expression instanceof Binary) {
type = ((BinaryImpl) expression).getType();
} else if (expression instanceof Method) {
type = ((MethodImpl) expression).getType();
} else if (expression instanceof Alias) {
final AliasQueryOption alias = ((AliasImpl) expression).getAlias();
type = alias == null || alias.getValue() == null ? null : getType(alias.getValue());
} else if (expression instanceof LambdaRef) {
throw new UriParserSemanticException("Type determination not implemented.",
UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED, expression.toString());
} else {
throw new UriParserSemanticException("Unknown expression type.",
UriParserSemanticException.MessageKeys.NOT_IMPLEMENTED, expression.toString());
}
if (type != null && type.getKind() == EdmTypeKind.DEFINITION) {
type = ((EdmTypeDefinition) type).getUnderlyingType();
}
return type;
}
示例6: visit
import org.apache.olingo.server.api.uri.queryoption.expression.Method; //导入依赖的package包/类
void visit(@SuppressWarnings("unused") Method expr) {
}
示例7: goParameter
import org.apache.olingo.server.api.uri.queryoption.expression.Method; //导入依赖的package包/类
public FilterValidator goParameter(final int parameterIndex) {
assertTrue("Current expression not a methodCall", curExpression instanceof Method);
Method methodCall = (Method) curExpression;
curExpression = methodCall.getParameters().get(parameterIndex);
return this;
}