@Override public Object get(final Object key) { if (this.expressionObjects.containsObject(key.toString())) { final Object expressionObject = this.expressionObjects.getObject(key.toString()); // We need to first check if we are in a restricted environment. If so, restrict access to the request. if (this.restrictedExpressionExecution && (StandardExpressionObjectFactory.REQUEST_EXPRESSION_OBJECT_NAME.equals(key) || StandardExpressionObjectFactory.HTTP_SERVLET_REQUEST_EXPRESSION_OBJECT_NAME.equals(key))) { return RestrictedRequestAccessUtils.wrapRequestObject(expressionObject); } return expressionObject; } return super.get(key); }
@Override public Set<String> keySet() { if (super.isEmpty()) { return this.expressionObjects.getObjectNames(); } final Set<String> keys = new LinkedHashSet<String>(this.expressionObjects.getObjectNames()); keys.addAll(super.keySet()); return keys; }
@Override public int size() { return super.size() + this.expressionObjects.size(); }
"in future versions of Thymeleaf.", TemplateEngine.threadIndex()); return ((IThymeleafEvaluationContext)context).getExpressionObjects().getObject("execInfo");
@Override public Object remove(final Object key) { if (this.expressionObjects.containsObject(key.toString())) { throw new IllegalArgumentException( "Cannot remove entry with key \"" + key + "\" from Expression Objects wrapper map: key matches the " + "name of one of the expression objects"); } return super.remove(key); }
"in future versions of Thymeleaf.", TemplateEngine.threadIndex()); return ((IThymeleafEvaluationContext)context).getExpressionObjects().getObject("execInfo");
@Override public boolean containsKey(final Object key) { return this.expressionObjects.containsObject(key.toString()) || super.containsKey(key); }
@Override public Object lookupVariable(final String name) { if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) { final Object result = this.expressionObjects.getObject(name); if (result != null) { // We need to first check if we are in a restricted environment. If so, restrict access to the request. if (this.variableAccessRestricted && (StandardExpressionObjectFactory.REQUEST_EXPRESSION_OBJECT_NAME.equals(name) || StandardExpressionObjectFactory.HTTP_SERVLET_REQUEST_EXPRESSION_OBJECT_NAME.equals(name))) { return RestrictedRequestAccessUtils.wrapRequestObject(result); } return result; } } // fall back to superclass return super.lookupVariable(name); }
"in future versions of Thymeleaf.", TemplateEngine.threadIndex()); return ((IThymeleafEvaluationContext)context).getExpressionObjects().getObject("execInfo");
@Override public Object put(final String key, final Object value) { if (this.expressionObjects.containsObject(key.toString())) { throw new IllegalArgumentException( "Cannot put entry with key \"" + key + "\" into Expression Objects wrapper map: key matches the " + "name of one of the expression objects"); } return super.put(key, value); }
@Override public boolean isEmpty() { return this.expressionObjects.size() == 0 && super.isEmpty(); }
public Object lookupVariable(final String name) { if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) { final Object result = this.expressionObjects.getObject(name); if (result != null) { // We need to first check if we are in a restricted environment. If so, restrict access to the request. if (this.requestParametersRestricted && (StandardExpressionObjectFactory.REQUEST_EXPRESSION_OBJECT_NAME.equals(name) || StandardExpressionObjectFactory.HTTP_SERVLET_REQUEST_EXPRESSION_OBJECT_NAME.equals(name))) { return RestrictedRequestAccessUtils.wrapRequestObject(result); } return result; } } if (this.additionalVariables != null && this.additionalVariables.containsKey(name)) { final Object result = this.additionalVariables.get(name); if (result != null) { return result; } } // fall back to delegate return this.delegate.lookupVariable(name); }
"in future versions of Thymeleaf.", TemplateEngine.threadIndex()); return ((IThymeleafEvaluationContext)context).getExpressionObjects().getObject("execInfo");
public Object lookupVariable(final String name) { if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) { final Object result = this.expressionObjects.getObject(name); if (result != null) { // We need to first check if we are in a restricted environment. If so, restrict access to the request. if (this.requestParametersRestricted && (StandardExpressionObjectFactory.REQUEST_EXPRESSION_OBJECT_NAME.equals(name) || StandardExpressionObjectFactory.HTTP_SERVLET_REQUEST_EXPRESSION_OBJECT_NAME.equals(name))) { return RestrictedRequestAccessUtils.wrapRequestObject(result); } return result; } } if (this.additionalVariables != null && this.additionalVariables.containsKey(name)) { final Object result = this.additionalVariables.get(name); if (result != null) { return result; } } // fall back to delegate return this.delegate.lookupVariable(name); }
"in future versions of Thymeleaf.", TemplateEngine.threadIndex()); return ((IThymeleafEvaluationContext)context).getExpressionObjects().getObject("execInfo");
@Override public Object lookupVariable(final String name) { if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) { final Object result = this.expressionObjects.getObject(name); if (result != null) { // We need to first check if we are in a restricted environment. If so, restrict access to the request. if (this.variableAccessRestricted && (StandardExpressionObjectFactory.REQUEST_EXPRESSION_OBJECT_NAME.equals(name) || StandardExpressionObjectFactory.HTTP_SERVLET_REQUEST_EXPRESSION_OBJECT_NAME.equals(name))) { return RestrictedRequestAccessUtils.wrapRequestObject(result); } return result; } } // fall back to superclass return super.lookupVariable(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; }
@Override public Object lookupVariable(final String name) { if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) { final Object result = this.expressionObjects.getObject(name); if (result != null) { // We need to first check if we are in a restricted environment. If so, restrict access to the request. if (this.variableAccessRestricted && (StandardExpressionObjectFactory.REQUEST_EXPRESSION_OBJECT_NAME.equals(name) || StandardExpressionObjectFactory.HTTP_SERVLET_REQUEST_EXPRESSION_OBJECT_NAME.equals(name))) { return RestrictedRequestAccessUtils.wrapRequestObject(result); } return result; } } // fall back to superclass return super.lookupVariable(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; }
@Override public Object lookupVariable(final String name) { if (this.expressionObjects != null && this.expressionObjects.containsObject(name)) { final Object result = this.expressionObjects.getObject(name); if (result != null) { // We need to first check if we are in a restricted environment. If so, restrict access to the request. if (this.variableAccessRestricted && (StandardExpressionObjectFactory.REQUEST_EXPRESSION_OBJECT_NAME.equals(name) || StandardExpressionObjectFactory.HTTP_SERVLET_REQUEST_EXPRESSION_OBJECT_NAME.equals(name))) { return RestrictedRequestAccessUtils.wrapRequestObject(result); } return result; } } // fall back to superclass return super.lookupVariable(name); }