Java Code Examples for org.springframework.expression.spel.standard.SpelExpression#getAST()

The following examples show how to use org.springframework.expression.spel.standard.SpelExpression#getAST() . These examples are extracted from open source projects. 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 Project: spring-analysis-note   File: ListTests.java    License: MIT License 5 votes vote down vote up
private void checkConstantList(String expressionText, boolean expectedToBeConstant) {
	SpelExpressionParser parser = new SpelExpressionParser();
	SpelExpression expression = (SpelExpression) parser.parseExpression(expressionText);
	SpelNode node = expression.getAST();
	assertTrue(node instanceof InlineList);
	InlineList inlineList = (InlineList) node;
	if (expectedToBeConstant) {
		assertTrue(inlineList.isConstant());
	}
	else {
		assertFalse(inlineList.isConstant());
	}
}
 
Example 2
Source Project: spring-analysis-note   File: MapTests.java    License: MIT License 5 votes vote down vote up
private void checkConstantMap(String expressionText, boolean expectedToBeConstant) {
	SpelExpressionParser parser = new SpelExpressionParser();
	SpelExpression expression = (SpelExpression) parser.parseExpression(expressionText);
	SpelNode node = expression.getAST();
	assertTrue(node instanceof InlineMap);
	InlineMap inlineMap = (InlineMap) node;
	if (expectedToBeConstant) {
		assertTrue(inlineMap.isConstant());
	}
	else {
		assertFalse(inlineMap.isConstant());
	}
}
 
Example 3
Source Project: java-technology-stack   File: ListTests.java    License: MIT License 5 votes vote down vote up
private void checkConstantList(String expressionText, boolean expectedToBeConstant) {
	SpelExpressionParser parser = new SpelExpressionParser();
	SpelExpression expression = (SpelExpression) parser.parseExpression(expressionText);
	SpelNode node = expression.getAST();
	assertTrue(node instanceof InlineList);
	InlineList inlineList = (InlineList) node;
	if (expectedToBeConstant) {
		assertTrue(inlineList.isConstant());
	}
	else {
		assertFalse(inlineList.isConstant());
	}
}
 
Example 4
Source Project: java-technology-stack   File: MapTests.java    License: MIT License 5 votes vote down vote up
private void checkConstantMap(String expressionText, boolean expectedToBeConstant) {
	SpelExpressionParser parser = new SpelExpressionParser();
	SpelExpression expression = (SpelExpression) parser.parseExpression(expressionText);
	SpelNode node = expression.getAST();
	assertTrue(node instanceof InlineMap);
	InlineMap inlineMap = (InlineMap) node;
	if (expectedToBeConstant) {
		assertTrue(inlineMap.isConstant());
	}
	else {
		assertFalse(inlineMap.isConstant());
	}
}
 
Example 5
Source Project: spring4-understanding   File: ListTests.java    License: Apache License 2.0 5 votes vote down vote up
private void checkConstantList(String expressionText, boolean expectedToBeConstant) {
	SpelExpressionParser parser = new SpelExpressionParser();
	SpelExpression expression = (SpelExpression) parser.parseExpression(expressionText);
	SpelNode node = expression.getAST();
	assertTrue(node instanceof InlineList);
	InlineList inlineList = (InlineList) node;
	if (expectedToBeConstant) {
		assertTrue(inlineList.isConstant());
	}
	else {
		assertFalse(inlineList.isConstant());
	}
}
 
Example 6
Source Project: spring4-understanding   File: MapTests.java    License: Apache License 2.0 5 votes vote down vote up
private void checkConstantMap(String expressionText, boolean expectedToBeConstant) {
	SpelExpressionParser parser = new SpelExpressionParser();
	SpelExpression expression = (SpelExpression) parser.parseExpression(expressionText);
	SpelNode node = expression.getAST();
	assertTrue(node instanceof InlineMap);
	InlineMap inlineMap = (InlineMap) node;
	if (expectedToBeConstant) {
		assertTrue(inlineMap.isConstant());
	}
	else {
		assertFalse(inlineMap.isConstant());
	}
}
 
Example 7
Source Project: spring-analysis-note   File: OperatorTests.java    License: MIT License 4 votes vote down vote up
private Operator getOperatorNode(SpelExpression expr) {
	SpelNode node = expr.getAST();
	return findOperator(node);
}
 
Example 8
Source Project: java-technology-stack   File: OperatorTests.java    License: MIT License 4 votes vote down vote up
private Operator getOperatorNode(SpelExpression expr) {
	SpelNode node = expr.getAST();
	return findOperator(node);
}
 
Example 9
private Operator getOperatorNode(SpelExpression expr) {
	SpelNode node = expr.getAST();
	return findOperator(node);
}
 
Example 10
private SpelNodeImpl getAst() {
	SpelExpression spelExpression = (SpelExpression)expression;
	SpelNode ast = spelExpression.getAST();
	return (SpelNodeImpl)ast;
}