本文整理汇总了Java中org.springframework.expression.spel.ast.VariableReference类的典型用法代码示例。如果您正苦于以下问题:Java VariableReference类的具体用法?Java VariableReference怎么用?Java VariableReference使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
VariableReference类属于org.springframework.expression.spel.ast包,在下文中一共展示了VariableReference类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: maybeEatFunctionOrVar
import org.springframework.expression.spel.ast.VariableReference; //导入依赖的package包/类
private boolean maybeEatFunctionOrVar() {
if (!peekToken(TokenKind.HASH)) {
return false;
}
Token t = nextToken();
Token functionOrVariableName = eatToken(TokenKind.IDENTIFIER);
SpelNodeImpl[] args = maybeEatMethodArgs();
if (args == null) {
push(new VariableReference(functionOrVariableName.data, toPos(t.startPos,
functionOrVariableName.endPos)));
return true;
}
push(new FunctionReference(functionOrVariableName.data, toPos(t.startPos,
functionOrVariableName.endPos), args));
return true;
}
示例2: handle
import org.springframework.expression.spel.ast.VariableReference; //导入依赖的package包/类
private void handle(SpelNode node, Class<?> expressionRoot) throws ExpressionValidationException{
if (node instanceof MethodReference) {
verify((MethodReference) node, expressionRoot);
} else if (node instanceof Operator) {
Operator operator = (Operator) node;
handle(operator.getLeftOperand(), expressionRoot);
handle(operator.getRightOperand(), expressionRoot);
} else if (node != null) {
for(int i=0; i<node.getChildCount(); i++) {
SpelNode child = node.getChild(i);
if (child instanceof VariableReference ||
child instanceof TypeReference ||
child instanceof BeanReference) {
// stop inspecting if it's a variable or type reference.
// We can handle this later if we get smart about resolving these
break;
}
handle(child, expressionRoot);
}
}
}