Java Code Examples for org.springframework.expression.ParserContext

The following examples show how to use org.springframework.expression.ParserContext. 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
@Override
protected SpelExpression doParseExpression(String expressionString, @Nullable ParserContext context)
		throws ParseException {

	try {
		this.expressionString = expressionString;
		Tokenizer tokenizer = new Tokenizer(expressionString);
		this.tokenStream = tokenizer.process();
		this.tokenStreamLength = this.tokenStream.size();
		this.tokenStreamPointer = 0;
		this.constructedNodes.clear();
		SpelNodeImpl ast = eatExpression();
		Assert.state(ast != null, "No node");
		Token t = peekToken();
		if (t != null) {
			throw new SpelParseException(t.startPos, SpelMessage.MORE_INPUT, toString(nextToken()));
		}
		Assert.isTrue(this.constructedNodes.isEmpty(), "At least one node expected");
		return new SpelExpression(expressionString, ast, this.configuration);
	}
	catch (InternalParseException ex) {
		throw ex.getCause();
	}
}
 
Example 2
Source Project: java-master   Source File: SpELTest.java    License: Apache License 2.0 6 votes vote down vote up
@Test
public void test2() {
    // 可以解析对象属性值
    CreateUserReqVo createUserReqVo = new CreateUserReqVo();
    createUserReqVo.setUsername("liangyudong");
    createUserReqVo.setPassword("123456");

    // 标准写法
    Expression exp = parser.parseExpression("username");
    logger.info((String) exp.getValue(createUserReqVo));

    EvaluationContext context = new StandardEvaluationContext(createUserReqVo);
    logger.info((String) exp.getValue(context));

    // 模板写法,同@Value注解的写法
    logger.info(parser.parseExpression("#{username}", ParserContext.TEMPLATE_EXPRESSION).getValue(context).toString());
}
 
Example 3
@Override
protected SpelExpression doParseExpression(String expressionString, @Nullable ParserContext context)
		throws ParseException {

	try {
		this.expressionString = expressionString;
		Tokenizer tokenizer = new Tokenizer(expressionString);
		this.tokenStream = tokenizer.process();
		this.tokenStreamLength = this.tokenStream.size();
		this.tokenStreamPointer = 0;
		this.constructedNodes.clear();
		SpelNodeImpl ast = eatExpression();
		Assert.state(ast != null, "No node");
		Token t = peekToken();
		if (t != null) {
			throw new SpelParseException(t.startPos, SpelMessage.MORE_INPUT, toString(nextToken()));
		}
		Assert.isTrue(this.constructedNodes.isEmpty(), "At least one node expected");
		return new SpelExpression(expressionString, ast, this.configuration);
	}
	catch (InternalParseException ex) {
		throw ex.getCause();
	}
}
 
Example 4
Source Project: java-technology-stack   Source File: SpelReproTests.java    License: MIT License 6 votes vote down vote up
private void checkTemplateParsingError(String expression, ParserContext context, String expectedMessage) {
	SpelExpressionParser parser = new SpelExpressionParser();
	try {
		parser.parseExpression(expression, context);
		fail("Should have failed with message: " + expectedMessage);
	}
	catch (Exception ex) {
		String message = ex.getMessage();
		if (ex instanceof ExpressionException) {
			message = ((ExpressionException) ex).getSimpleMessage();
		}
		if (!message.equals(expectedMessage)) {
			ex.printStackTrace();
		}
		assertThat(expectedMessage, equalTo(message));
	}
}
 
Example 5
Source Project: spring-data   Source File: DefaultArangoPersistentEntity.java    License: Apache License 2.0 6 votes vote down vote up
public DefaultArangoPersistentEntity(final TypeInformation<T> information) {
	super(information);
	collection = StringUtils.uncapitalize(information.getType().getSimpleName());
	context = new StandardEvaluationContext();
	hashIndexedProperties = new ArrayList<>();
	skiplistIndexedProperties = new ArrayList<>();
	persistentIndexedProperties = new ArrayList<>();
	geoIndexedProperties = new ArrayList<>();
	fulltextIndexedProperties = new ArrayList<>();
	repeatableAnnotationCache = new HashMap<>();
	final Document document = findAnnotation(Document.class);
	final Edge edge = findAnnotation(Edge.class);
	if (edge != null) {
		collection = StringUtils.hasText(edge.value()) ? edge.value() : collection;
		collectionOptions = createCollectionOptions(edge);
	} else if (document != null) {
		collection = StringUtils.hasText(document.value()) ? document.value() : collection;
		collectionOptions = createCollectionOptions(document);
	} else {
		collectionOptions = new CollectionCreateOptions().type(CollectionType.DOCUMENT);
	}
	expression = PARSER.parseExpression(collection, ParserContext.TEMPLATE_EXPRESSION);
}
 
Example 6
@Override
protected SpelExpression doParseExpression(String expressionString, ParserContext context) throws ParseException {
	try {
		this.expressionString = expressionString;
		Tokenizer tokenizer = new Tokenizer(expressionString);
		this.tokenStream = tokenizer.process();
		this.tokenStreamLength = this.tokenStream.size();
		this.tokenStreamPointer = 0;
		this.constructedNodes.clear();
		SpelNodeImpl ast = eatExpression();
		if (moreTokens()) {
			throw new SpelParseException(peekToken().startPos, SpelMessage.MORE_INPUT, toString(nextToken()));
		}
		Assert.isTrue(this.constructedNodes.isEmpty(), "At least one node expected");
		return new SpelExpression(expressionString, ast, this.configuration);
	}
	catch (InternalParseException ex) {
		throw ex.getCause();
	}
}
 
Example 7
@Override
protected SpelExpression doParseExpression(String expressionString, ParserContext context) throws ParseException {
	try {
		this.expressionString = expressionString;
		Tokenizer tokenizer = new Tokenizer(expressionString);
		tokenizer.process();
		this.tokenStream = tokenizer.getTokens();
		this.tokenStreamLength = this.tokenStream.size();
		this.tokenStreamPointer = 0;
		this.constructedNodes.clear();
		SpelNodeImpl ast = eatExpression();
		if (moreTokens()) {
			throw new SpelParseException(peekToken().startPos, SpelMessage.MORE_INPUT, toString(nextToken()));
		}
		Assert.isTrue(this.constructedNodes.isEmpty());
		return new SpelExpression(expressionString, ast, this.configuration);
	}
	catch (InternalParseException ex) {
		throw ex.getCause();
	}
}
 
Example 8
Source Project: spring4-understanding   Source File: SpelReproTests.java    License: Apache License 2.0 6 votes vote down vote up
private void checkTemplateParsingError(String expression, ParserContext context, String expectedMessage) throws Exception {
	SpelExpressionParser parser = new SpelExpressionParser();
	try {
		parser.parseExpression(expression, context);
		fail("Should have failed with message: " + expectedMessage);
	}
	catch (Exception ex) {
		String message = ex.getMessage();
		if (ex instanceof ExpressionException) {
			message = ((ExpressionException) ex).getSimpleMessage();
		}
		if (!message.equals(expectedMessage)) {
			ex.printStackTrace();
		}
		assertThat(expectedMessage, equalTo(message));
	}
}
 
Example 9
Source Project: ignite   Source File: ExpressionBasedStringQuery.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param qry,     the query expression potentially containing a SpEL expression. Must not be {@literal null}.}
 * @param metadata the {@link RepositoryMetadata} for the given entity. Must not be {@literal null}.
 * @param parser   Must not be {@literal null}.
 * @return rendered query
 */
private static String renderQueryIfExpressionOrReturnQuery(String qry,
    RepositoryMetadata metadata,
    SpelExpressionParser parser) {

    Assert.notNull(qry, "query must not be null!");
    Assert.notNull(metadata, "metadata must not be null!");
    Assert.notNull(parser, "parser must not be null!");

    if (!containsExpression(qry))
        return qry;

    StandardEvaluationContext evalCtx = new StandardEvaluationContext();
    evalCtx.setVariable(ENTITY_NAME, metadata.getDomainType().getSimpleName());

    qry = potentiallyQuoteExpressionsParameter(qry);

    Expression expr = parser.parseExpression(qry, ParserContext.TEMPLATE_EXPRESSION);

    String result = expr.getValue(evalCtx, String.class);

    if (result == null)
        return qry;

    return potentiallyUnquoteParameterExpressions(result);
}
 
Example 10
Source Project: ignite   Source File: ExpressionBasedStringQuery.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * @param qry,     the query expression potentially containing a SpEL expression. Must not be {@literal null}.}
 * @param metadata the {@link RepositoryMetadata} for the given entity. Must not be {@literal null}.
 * @param parser   Must not be {@literal null}.
 * @return rendered query
 */
private static String renderQueryIfExpressionOrReturnQuery(String qry,
    RepositoryMetadata metadata,
    SpelExpressionParser parser) {

    Assert.notNull(qry, "query must not be null!");
    Assert.notNull(metadata, "metadata must not be null!");
    Assert.notNull(parser, "parser must not be null!");

    if (!containsExpression(qry))
        return qry;

    StandardEvaluationContext evalCtx = new StandardEvaluationContext();
    evalCtx.setVariable(ENTITY_NAME, metadata.getDomainType().getSimpleName());

    qry = potentiallyQuoteExpressionsParameter(qry);

    Expression expr = parser.parseExpression(qry, ParserContext.TEMPLATE_EXPRESSION);

    String result = expr.getValue(evalCtx, String.class);

    if (result == null)
        return qry;

    return potentiallyUnquoteParameterExpressions(result);
}
 
Example 11
Source Project: vividus   Source File: ConfigurationResolver.java    License: Apache License 2.0 5 votes vote down vote up
private static void resolveSpelExpressions(Properties properties, boolean ignoreValuesWithPropertyPlaceholders)
{
    Optional<Set<String>> propertyPlaceholders = ignoreValuesWithPropertyPlaceholders
            ? Optional.of(properties.stringPropertyNames().stream()
                    .map(n -> PLACEHOLDER_PREFIX + n + PLACEHOLDER_SUFFIX)
                    .collect(Collectors.toSet()))
            : Optional.empty();

    SpelExpressionParser spelExpressionParser = new SpelExpressionParser();
    for (Entry<Object, Object> entry : properties.entrySet())
    {
        String value = (String) entry.getValue();
        if (propertyPlaceholders.stream().flatMap(Set::stream).noneMatch(value::contains))
        {
            try
            {
                entry.setValue(
                        spelExpressionParser.parseExpression(value, ParserContext.TEMPLATE_EXPRESSION).getValue());
            }
            catch (Exception e)
            {
                throw new IllegalStateException("Exception during evaluation of expression " + value
                        + " for property '" + entry.getKey() + "'", e);
            }
        }
    }
}
 
Example 12
@Override
public Expression parseExpression(String expressionString, @Nullable ParserContext context) throws ParseException {
	if (context != null && context.isTemplate()) {
		return parseTemplate(expressionString, context);
	}
	else {
		return doParseExpression(expressionString, context);
	}
}
 
Example 13
private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException {
	if (expressionString.isEmpty()) {
		return new LiteralExpression("");
	}

	Expression[] expressions = parseExpressions(expressionString, context);
	if (expressions.length == 1) {
		return expressions[0];
	}
	else {
		return new CompositeStringExpression(expressionString, expressions);
	}
}
 
Example 14
Source Project: spring-analysis-note   Source File: SpelReproTests.java    License: MIT License 5 votes vote down vote up
private void checkTemplateParsingError(String expression, ParserContext context, String expectedMessage) {
	SpelExpressionParser parser = new SpelExpressionParser();
	try {
		parser.parseExpression(expression, context);
		fail("Should have failed with message: " + expectedMessage);
	}
	catch (Exception ex) {
		String message = ex.getMessage();
		if (ex instanceof ExpressionException) {
			message = ((ExpressionException) ex).getSimpleMessage();
		}
		if (!message.equals(expectedMessage)) {
			ex.printStackTrace();
		}
		assertThat(expectedMessage, equalTo(message));
	}
}
 
Example 15
@Override
public Expression parseExpression(String expressionString, @Nullable ParserContext context) throws ParseException {
	if (context != null && context.isTemplate()) {
		return parseTemplate(expressionString, context);
	}
	else {
		return doParseExpression(expressionString, context);
	}
}
 
Example 16
private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException {
	if (expressionString.isEmpty()) {
		return new LiteralExpression("");
	}

	Expression[] expressions = parseExpressions(expressionString, context);
	if (expressions.length == 1) {
		return expressions[0];
	}
	else {
		return new CompositeStringExpression(expressionString, expressions);
	}
}
 
Example 17
Source Project: spring-data   Source File: ArangoTemplate.java    License: Apache License 2.0 5 votes vote down vote up
public ArangoTemplate(final ArangoDB arango, final String database, final ArangoConverter converter,
	final PersistenceExceptionTranslator exceptionTranslator) {
	super();
	this.arango = arango._setCursorInitializer(new ArangoCursorInitializer(converter));
	this.databaseName = database;
	this.databaseExpression = PARSER.parseExpression(databaseName, ParserContext.TEMPLATE_EXPRESSION);
	this.converter = converter;
	this.exceptionTranslator = exceptionTranslator;
	this.context = new StandardEvaluationContext();
	// set concurrency level to 1 as writes are very rare compared to reads
	collectionCache = new ConcurrentHashMap<>(8, 0.9f, 1);
	databaseCache = new ConcurrentHashMap<>(8, 0.9f, 1);
	version = null;
}
 
Example 18
Source Project: syndesis   Source File: DataManager.java    License: Apache License 2.0 5 votes vote down vote up
private boolean canLoad(ModelData<?> modelData) {
    if (this.environment != null && modelData.getCondition() != null) {
        ExpressionParser parser = new SpelExpressionParser();
        Expression ex = parser.parseExpression(modelData.getCondition(), ParserContext.TEMPLATE_EXPRESSION);
        return Optional.ofNullable(ex.getValue(this.environment, Boolean.class)).orElse(false);
    }
    return true;
}
 
Example 19
@Override
public Expression parseExpression(String expressionString, ParserContext context) throws ParseException {
	if (context == null) {
		context = NON_TEMPLATE_PARSER_CONTEXT;
	}

	if (context.isTemplate()) {
		return parseTemplate(expressionString, context);
	}
	else {
		return doParseExpression(expressionString, context);
	}
}
 
Example 20
private Expression parseTemplate(String expressionString, ParserContext context) throws ParseException {
	if (expressionString.isEmpty()) {
		return new LiteralExpression("");
	}

	Expression[] expressions = parseExpressions(expressionString, context);
	if (expressions.length == 1) {
		return expressions[0];
	}
	else {
		return new CompositeStringExpression(expressionString, expressions);
	}
}
 
Example 21
@Nullable
private Expression detectExpression() {
	if (!hasTableName()) {
		return null;
	}

	Expression expression = PARSER.parseExpression(this.kind.name(),
			ParserContext.TEMPLATE_EXPRESSION);

	return (expression instanceof LiteralExpression) ? null : expression;
}
 
Example 22
Source Project: spring-cloud-gcp   Source File: SqlSpannerQuery.java    License: Apache License 2.0 5 votes vote down vote up
private Expression[] detectExpressions(String sql) {
	Expression expression = this.expressionParser.parseExpression(sql,
			ParserContext.TEMPLATE_EXPRESSION);
	if (expression instanceof LiteralExpression) {
		return new Expression[] { expression };
	}
	else if (expression instanceof CompositeStringExpression) {
		return ((CompositeStringExpression) expression).getExpressions();
	}
	else {
		throw new SpannerDataException("Unexpected expression type. "
				+ "Query can either contain no SpEL expressions or have SpEL expressions in the SQL.");
	}
}
 
Example 23
@Nullable
private Expression detectExpression() {
	if (!hasAnnotatedTableName()) {
		return null;
	}

	Expression expression = PARSER.parseExpression(this.table.name(),
			ParserContext.TEMPLATE_EXPRESSION);

	return (expression instanceof LiteralExpression) ? null : expression;
}
 
Example 24
/**
 * @param query,   the query expression potentially containing a SpEL expression. Must not be {@literal null}.}
 * @param metadata the {@link EntityMetadata} for the given entity. Must not be {@literal null}.
 * @param parser   Must not be {@literal null}.
 * @return
 */
private static String renderQueryIfExpressionOrReturnQuery(String query, EntityMetadata<?> metadata,
                                                           SpelExpressionParser parser) {

    Assert.notNull(query, "query must not be null!");
    Assert.notNull(metadata, "metadata must not be null!");
    Assert.notNull(parser, "parser must not be null!");

    if (!containsExpression(query)) {
        return query;
    }

    StandardEvaluationContext evalContext = new StandardEvaluationContext();
    evalContext.setVariable(ENTITY_NAME, metadata.getJavaType().getName());

    query = potentiallyQuoteExpressionsParameter(query);

    Expression expr = parser.parseExpression(query, ParserContext.TEMPLATE_EXPRESSION);

    String result = expr.getValue(evalContext, String.class);

    if (result == null) {
        return query;
    }

    return potentiallyUnquoteParameterExpressions(result);
}
 
Example 25
private Expression parseTemplate(String expressionString, ParserContext context)
		throws ParseException {
	if (expressionString.length() == 0) {
		return new LiteralExpression("");
	}
	Expression[] expressions = parseExpressions(expressionString, context);
	if (expressions.length == 1) {
		return expressions[0];
	}
	else {
		return new CompositeStringExpression(expressionString, expressions);
	}
}
 
Example 26
Source Project: spring4-understanding   Source File: SpelReproTests.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void NPE_SPR5673() throws Exception {
	ParserContext hashes = TemplateExpressionParsingTests.HASH_DELIMITED_PARSER_CONTEXT;
	ParserContext dollars = TemplateExpressionParsingTests.DEFAULT_TEMPLATE_PARSER_CONTEXT;

	checkTemplateParsing("abc${'def'} ghi", "abcdef ghi");

	checkTemplateParsingError("abc${ {}( 'abc'", "Missing closing ')' for '(' at position 8");
	checkTemplateParsingError("abc${ {}[ 'abc'", "Missing closing ']' for '[' at position 8");
	checkTemplateParsingError("abc${ {}{ 'abc'", "Missing closing '}' for '{' at position 8");
	checkTemplateParsingError("abc${ ( 'abc' }", "Found closing '}' at position 14 but most recent opening is '(' at position 6");
	checkTemplateParsingError("abc${ '... }", "Found non terminating string literal starting at position 6");
	checkTemplateParsingError("abc${ \"... }", "Found non terminating string literal starting at position 6");
	checkTemplateParsingError("abc${ ) }", "Found closing ')' at position 6 without an opening '('");
	checkTemplateParsingError("abc${ ] }", "Found closing ']' at position 6 without an opening '['");
	checkTemplateParsingError("abc${ } }", "No expression defined within delimiter '${}' at character 3");
	checkTemplateParsingError("abc$[ } ]", DOLLARSQUARE_TEMPLATE_PARSER_CONTEXT, "Found closing '}' at position 6 without an opening '{'");

	checkTemplateParsing("abc ${\"def''g}hi\"} jkl", "abc def'g}hi jkl");
	checkTemplateParsing("abc ${'def''g}hi'} jkl", "abc def'g}hi jkl");
	checkTemplateParsing("}", "}");
	checkTemplateParsing("${'hello'} world", "hello world");
	checkTemplateParsing("Hello ${'}'}]", "Hello }]");
	checkTemplateParsing("Hello ${'}'}", "Hello }");
	checkTemplateParsingError("Hello ${ ( ", "No ending suffix '}' for expression starting at character 6: ${ ( ");
	checkTemplateParsingError("Hello ${ ( }", "Found closing '}' at position 11 but most recent opening is '(' at position 9");
	checkTemplateParsing("#{'Unable to render embedded object: File ({#this == 2}'}", hashes, "Unable to render embedded object: File ({#this == 2}");
	checkTemplateParsing("This is the last odd number in the list: ${listOfNumbersUpToTen.$[#this%2==1]}", dollars, "This is the last odd number in the list: 9");
	checkTemplateParsing("Hello ${'here is a curly bracket }'}", dollars, "Hello here is a curly bracket }");
	checkTemplateParsing("He${'${'}llo ${'here is a curly bracket }'}}", dollars, "He${llo here is a curly bracket }}");
	checkTemplateParsing("Hello ${'()()()}{}{}{][]{}{][}[][][}{()()'} World", dollars, "Hello ()()()}{}{}{][]{}{][}[][][}{()() World");
	checkTemplateParsing("Hello ${'inner literal that''s got {[(])]}an escaped quote in it'} World", "Hello inner literal that's got {[(])]}an escaped quote in it World");
	checkTemplateParsingError("Hello ${", "No ending suffix '}' for expression starting at character 6: ${");
}
 
Example 27
Source Project: kork   Source File: ExpressionTransform.java    License: Apache License 2.0 5 votes vote down vote up
public ExpressionTransform(
    ParserContext parserContext,
    ExpressionParser parser,
    Function<String, String> stringExpressionPreprocessor,
    Class<?>... typesToStringify) {
  this.parserContext = parserContext;
  this.parser = parser;
  this.stringExpressionPreprocessor = stringExpressionPreprocessor;
  this.typesToStringify = Arrays.asList(typesToStringify);
}
 
Example 28
Source Project: spring-analysis-note   Source File: SpelExpressionParser.java    License: MIT License 4 votes vote down vote up
@Override
protected SpelExpression doParseExpression(String expressionString, @Nullable ParserContext context) throws ParseException {
	return new InternalSpelExpressionParser(this.configuration).doParseExpression(expressionString, context);
}
 
Example 29
/**
 * Helper that parses given expression string using the configured parser. The
 * expression string can contain any number of expressions all contained in "${...}"
 * markers. For instance: "foo${expr0}bar${expr1}". The static pieces of text will
 * also be returned as Expressions that just return that static piece of text. As a
 * result, evaluating all returned expressions and concatenating the results produces
 * the complete evaluated string. Unwrapping is only done of the outermost delimiters
 * found, so the string 'hello ${foo${abc}}' would break into the pieces 'hello ' and
 * 'foo${abc}'. This means that expression languages that used ${..} as part of their
 * functionality are supported without any problem. The parsing is aware of the
 * structure of an embedded expression. It assumes that parentheses '(', square
 * brackets '[' and curly brackets '}' must be in pairs within the expression unless
 * they are within a string literal and a string literal starts and terminates with a
 * single quote '.
 * @param expressionString the expression string
 * @return the parsed expressions
 * @throws ParseException when the expressions cannot be parsed
 */
private Expression[] parseExpressions(String expressionString, ParserContext context) throws ParseException {
	List<Expression> expressions = new ArrayList<>();
	String prefix = context.getExpressionPrefix();
	String suffix = context.getExpressionSuffix();
	int startIdx = 0;

	while (startIdx < expressionString.length()) {
		int prefixIndex = expressionString.indexOf(prefix, startIdx);
		if (prefixIndex >= startIdx) {
			// an inner expression was found - this is a composite
			if (prefixIndex > startIdx) {
				expressions.add(new LiteralExpression(expressionString.substring(startIdx, prefixIndex)));
			}
			int afterPrefixIndex = prefixIndex + prefix.length();
			int suffixIndex = skipToCorrectEndSuffix(suffix, expressionString, afterPrefixIndex);
			if (suffixIndex == -1) {
				throw new ParseException(expressionString, prefixIndex,
						"No ending suffix '" + suffix + "' for expression starting at character " +
						prefixIndex + ": " + expressionString.substring(prefixIndex));
			}
			if (suffixIndex == afterPrefixIndex) {
				throw new ParseException(expressionString, prefixIndex,
						"No expression defined within delimiter '" + prefix + suffix +
						"' at character " + prefixIndex);
			}
			String expr = expressionString.substring(prefixIndex + prefix.length(), suffixIndex);
			expr = expr.trim();
			if (expr.isEmpty()) {
				throw new ParseException(expressionString, prefixIndex,
						"No expression defined within delimiter '" + prefix + suffix +
						"' at character " + prefixIndex);
			}
			expressions.add(doParseExpression(expr, context));
			startIdx = suffixIndex + suffix.length();
		}
		else {
			// no more ${expressions} found in string, add rest as static text
			expressions.add(new LiteralExpression(expressionString.substring(startIdx)));
			startIdx = expressionString.length();
		}
	}

	return expressions.toArray(new Expression[0]);
}
 
Example 30
Source Project: nifi   Source File: RulesSPELCondition.java    License: Apache License 2.0 4 votes vote down vote up
public RulesSPELCondition(String expression, ParserContext parserContext) {
    this.expression = expression;
    this.compiledExpression = this.parser.parseExpression(expression, parserContext);
}