Java Code Examples for org.springframework.expression.spel.ast.InlineMap

The following examples show how to use org.springframework.expression.spel.ast.InlineMap. 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   Source 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 2
Source Project: java-technology-stack   Source 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: spring4-understanding   Source 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());
	}
}