org.springframework.expression.spel.ast.CompoundExpression Java Examples

The following examples show how to use org.springframework.expression.spel.ast.CompoundExpression. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: InternalSpelExpressionParser.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Nullable
private SpelNodeImpl eatPrimaryExpression() {
	SpelNodeImpl start = eatStartNode();  // always a start node
	List<SpelNodeImpl> nodes = null;
	SpelNodeImpl node = eatNode();
	while (node != null) {
		if (nodes == null) {
			nodes = new ArrayList<>(4);
			nodes.add(start);
		}
		nodes.add(node);
		node = eatNode();
	}
	if (start == null || nodes == null) {
		return start;
	}
	return new CompoundExpression(start.getStartPosition(), nodes.get(nodes.size() - 1).getEndPosition(),
			nodes.toArray(new SpelNodeImpl[0]));
}
 
Example #2
Source File: InternalSpelExpressionParser.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Nullable
private SpelNodeImpl eatPrimaryExpression() {
	SpelNodeImpl start = eatStartNode();  // always a start node
	List<SpelNodeImpl> nodes = null;
	SpelNodeImpl node = eatNode();
	while (node != null) {
		if (nodes == null) {
			nodes = new ArrayList<>(4);
			nodes.add(start);
		}
		nodes.add(node);
		node = eatNode();
	}
	if (start == null || nodes == null) {
		return start;
	}
	return new CompoundExpression(toPos(start.getStartPosition(),
			nodes.get(nodes.size() - 1).getEndPosition()),
			nodes.toArray(new SpelNodeImpl[0]));
}
 
Example #3
Source File: InternalSpelExpressionParser.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
private SpelNodeImpl eatPrimaryExpression() {
	List<SpelNodeImpl> nodes = new ArrayList<SpelNodeImpl>();
	SpelNodeImpl start = eatStartNode();  // always a start node
	nodes.add(start);
	while (maybeEatNode()) {
		nodes.add(pop());
	}
	if (nodes.size() == 1) {
		return nodes.get(0);
	}
	return new CompoundExpression(toPos(start.getStartPosition(),
			nodes.get(nodes.size() - 1).getEndPosition()),
			nodes.toArray(new SpelNodeImpl[nodes.size()]));
}
 
Example #4
Source File: InternalSpelExpressionParser.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
private SpelNodeImpl eatPrimaryExpression() {
	List<SpelNodeImpl> nodes = new ArrayList<SpelNodeImpl>();
	SpelNodeImpl start = eatStartNode();  // always a start node
	nodes.add(start);
	while (maybeEatNode()) {
		nodes.add(pop());
	}
	if (nodes.size() == 1) {
		return nodes.get(0);
	}
	return new CompoundExpression(toPos(start.getStartPosition(),
			nodes.get(nodes.size() - 1).getEndPosition()),
			nodes.toArray(new SpelNodeImpl[nodes.size()]));
}