final IEngineConfiguration configuration = context.getConfiguration(); final IExpressionObjects expressionObjects = context.getExpressionObjects(); contextVariablesMap = new OGNLExpressionObjectsWrapper(expressionObjects, expContext.getRestrictVariableAccess());
final IEngineConfiguration configuration = context.getConfiguration(); (exp.mightNeedExpressionObjects? context.getExpressionObjects() : null); getVariable(ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME);
public Object buildObject(final IExpressionContext context, final String expressionObjectName) { if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) { if (SpringVersionSpecificUtils.isWebContext(context)) { return AuthUtils.getAuthenticationObject(context); } } if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) { if (SpringVersionSpecificUtils.isWebContext(context)) { // We retrieve it like this in order to give it the opportunity to come from cache final Authentication authentication = (Authentication) context.getExpressionObjects().getObject(AUTHENTICATION_EXPRESSION_OBJECT_NAME); return new Authorization(context, authentication); } return null; } return null; }
public Object convert(final Object target, final Class<?> clazz) { final IStandardConversionService conversionService = StandardExpressions.getConversionService(this.context.getConfiguration()); return conversionService.convert(this.context, target, clazz); }
/** * Constructor, obtains the current theme and locale from the processing * context for code lookups later. * * @param context the processing context being used */ public Themes(final IExpressionContext context) { super(); this.locale = context.getLocale(); final RequestContext requestContext = (RequestContext) context.getVariable(SpringContextVariableNames.SPRING_REQUEST_CONTEXT); this.theme = requestContext != null ? requestContext.getTheme() : null; }
/** * <p> * Get the {@link IThymeleafRequestContext} from the Thymeleaf context. * </p> * <p> * The returned object is a wrapper on the Spring request context that hides the fact of this request * context corresponding to a Spring WebMVC or Spring WebFlux application. * </p> * <p> * This will be done by looking for a context variable called * {@link SpringContextVariableNames#THYMELEAF_REQUEST_CONTEXT}. * </p> * * @param context the context * @return the thymeleaf request context */ public static IThymeleafRequestContext getRequestContext(final IExpressionContext context) { if (context == null) { return null; } return (IThymeleafRequestContext) context.getVariable(SpringContextVariableNames.THYMELEAF_REQUEST_CONTEXT); }
final IEngineConfiguration configuration = context.getConfiguration(); (exp.mightNeedExpressionObjects? context.getExpressionObjects() : null); getVariable(ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME);
public Object buildObject(final IExpressionContext context, final String expressionObjectName) { if (AUTHENTICATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) { if (SpringVersionSpecificUtils.isWebContext(context)) { return AuthUtils.getAuthenticationObject(context); } } if (AUTHORIZATION_EXPRESSION_OBJECT_NAME.equals(expressionObjectName)) { if (SpringVersionSpecificUtils.isWebContext(context)) { // We retrieve it like this in order to give it the opportunity to come from cache final Authentication authentication = (Authentication) context.getExpressionObjects().getObject(AUTHENTICATION_EXPRESSION_OBJECT_NAME); return new Authorization(context, authentication); } return null; } return null; }
final IStandardExpressionParser expressionParser = StandardExpressions.getExpressionParser(context.getConfiguration()); if (!(expressionParser instanceof StandardExpressionParser)) {
/** * Constructor, obtains the current theme and locale from the processing * context for code lookups later. * * @param context the processing context being used */ public Themes(final IExpressionContext context) { super(); this.locale = context.getLocale(); final RequestContext requestContext = (RequestContext) context.getVariable(SpringContextVariableNames.SPRING_REQUEST_CONTEXT); this.theme = requestContext != null ? requestContext.getTheme() : null; }
private static TypeConverter getSpringConversionService(final IExpressionContext context) { final EvaluationContext evaluationContext = (EvaluationContext) context.getVariable( ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME); if (evaluationContext != null) { return evaluationContext.getTypeConverter(); } return null; }
final IEngineConfiguration configuration = context.getConfiguration(); (exp.mightNeedExpressionObjects? context.getExpressionObjects() : null); getVariable(ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME);
IExpressionObjects expressionObjects = context.getExpressionObjects();
public Object execute( final IExpressionContext context, final StandardExpressionExecutionContext expContext) { Validate.notNull(context, "Context cannot be null"); final IStandardVariableExpressionEvaluator variableExpressionEvaluator = StandardExpressions.getVariableExpressionEvaluator(context.getConfiguration()); final Object result = execute(context, this, variableExpressionEvaluator, expContext); return LiteralValue.unwrap(result); }
/** * Constructor, obtains the current theme and locale from the processing * context for code lookups later. * * @param context the processing context being used */ public Themes(final IExpressionContext context) { super(); this.locale = context.getLocale(); final RequestContext requestContext = (RequestContext) context.getVariable(SpringContextVariableNames.SPRING_REQUEST_CONTEXT); this.theme = requestContext != null ? requestContext.getTheme() : null; }
private static TypeConverter getSpringConversionService(final IExpressionContext context) { final EvaluationContext evaluationContext = (EvaluationContext) context.getVariable( ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME); if (evaluationContext != null) { return evaluationContext.getTypeConverter(); } return null; }
@Override public Object buildObject(IExpressionContext context, String expressionObjectName) { if (TEMPORAL_EVALUATION_VARIABLE_NAME.equals(expressionObjectName)) { return new Temporals(context.getLocale()); } return null; }
final IEngineConfiguration configuration = context.getConfiguration(); (exp.mightNeedExpressionObjects? context.getExpressionObjects() : null); getVariable(ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME);
IExpressionObjects expressionObjects = context.getExpressionObjects();