com.github.osvaldopina.linkbuilder.expression.impl.SecurityExpressionParser Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of linkbuilder Show documentation
Show all versions of linkbuilder Show documentation
Link builder for Spring Hateoas projects.
package com.github.osvaldopina.linkbuilder.expression.impl;
import org.springframework.context.ApplicationContext;
import org.springframework.expression.Expression;
import java.util.HashMap;
import java.util.Map;
public class SecurityExpressionParser {
private Map expressionCache = new HashMap();
private SecurityExpressionHandler securityExpressionHandler =
new SecurityExpressionHandler();
public Expression parse(ApplicationContext applicationContext, String expression) {
Expression parsedExpression = expressionCache.get(expression);
if (parsedExpression == null) {
parsedExpression = securityExpressionHandler.parse(applicationContext, expression);
expressionCache.put(expression, parsedExpression);
}
return parsedExpression;
}
}