class SPELContextMapWrapper implements Map {

    private static final String REQUEST_PARAMETERS_RESTRICTED_VARIABLE_NAME = "param";


    private final IContext context;
    private final IThymeleafEvaluationContext evaluationContext;



    SPELContextMapWrapper(final IContext context, final IThymeleafEvaluationContext evaluationContext) {
        super();
        this.context = context;
        this.evaluationContext = evaluationContext;
    }









    public int size() {
        throw new TemplateProcessingException(
                "Cannot call #size() on an " + IContext.class.getSimpleName() + " implementation");
    }




    public boolean isEmpty() {
        throw new TemplateProcessingException(
                "Cannot call #isEmpty() on an " + IContext.class.getSimpleName() + " implementation");
    }




    public boolean containsKey(final Object key) {
        if (this.evaluationContext.isVariableAccessRestricted()) {
            if (REQUEST_PARAMETERS_RESTRICTED_VARIABLE_NAME.equals(key)) {
                throw new TemplateProcessingException(
                        "Access to variable \"" + key + "\" is forbidden in this context. Note some restrictions apply to " +
                        "variable access. For example, direct access to request parameters is forbidden in preprocessing and " +
                        "unescaped expressions, in TEXT template mode, in fragment insertion specifications and " +
                        "in some specific attribute processors.");
            }
        }
        // We will be NOT calling this.context.containsVariable(key) as it could be very inefficient in web
        // environments (based on HttpServletRequest#getAttributeName()), so we will just consider that every possible
        // element exists in an IContext, and simply return null for those not found
        return this.context != null;
    }




    public boolean containsValue(final Object value) {
        throw new TemplateProcessingException(
                "Cannot call #containsValue(value) on an " + IContext.class.getSimpleName() + " implementation");
    }




    public Object get(final Object key) {

        if (this.context == null) {
            throw new TemplateProcessingException("Cannot read property on null target");
        }

        return this.context.getVariable(key == null? null : key.toString());

    }




    public Object put(final Object key, final Object value) {
        throw new TemplateProcessingException(
                "Cannot call #put(key,value) on an " + IContext.class.getSimpleName() + " implementation");
    }




    public Object remove(final Object key) {
        throw new TemplateProcessingException(
                "Cannot call #remove(key) on an " + IContext.class.getSimpleName() + " implementation");
    }




    public void putAll(final Map m) {
        throw new TemplateProcessingException(
                "Cannot call #putAll(m) on an " + IContext.class.getSimpleName() + " implementation");
    }




    public void clear() {
        throw new TemplateProcessingException(
                "Cannot call #clear() on an " + IContext.class.getSimpleName() + " implementation");
    }




    public Set keySet() {
        throw new TemplateProcessingException(
                "Cannot call #keySet() on an " + IContext.class.getSimpleName() + " implementation");
    }




    public Collection values() {
        throw new TemplateProcessingException(
                "Cannot call #values() on an " + IContext.class.getSimpleName() + " implementation");
    }




    public Set<Entry> entrySet() {<FILL_FUNCTION_BODY>}


}

        throw new TemplateProcessingException(
                "Cannot call #entrySet() on an " + IContext.class.getSimpleName() + " implementation");
    
<no_super_class>