class ElementModelStructureHandler implements IElementModelStructureHandler {


    boolean setLocalVariable;
    Map<String,Object> addedLocalVariables;

    boolean removeLocalVariable;
    Set<String> removedLocalVariableNames;

    boolean setSelectionTarget;
    Object selectionTargetObject;

    boolean setInliner;
    IInliner setInlinerValue;

    boolean setTemplateData;
    TemplateData setTemplateDataValue;




    ElementModelStructureHandler() {
        super();
        reset();
    }



    public void removeLocalVariable(final String name) {
        // Can be combined with others, no need to resetGathering
        this.removeLocalVariable = true;
        if (this.removedLocalVariableNames == null) {
            this.removedLocalVariableNames = new HashSet<String>(3);
        }
        this.removedLocalVariableNames.add(name);
    }


    public void setLocalVariable(final String name, final Object value) {<FILL_FUNCTION_BODY>}


    public void setSelectionTarget(final Object selectionTarget) {
        // Can be combined with others, no need to resetGathering
        this.setSelectionTarget = true;
        this.selectionTargetObject = selectionTarget;
    }


    public void setInliner(final IInliner inliner) {
        this.setInliner = true;
        this.setInlinerValue = inliner;
    }


    public void setTemplateData(final TemplateData templateData) {
        this.setTemplateData = true;
        this.setTemplateDataValue = templateData;
    }




    public void reset() {

        this.setLocalVariable = false;
        if (this.addedLocalVariables != null && this.addedLocalVariables.size() > 0) {
            this.addedLocalVariables.clear();
        }

        this.removeLocalVariable = false;
        if (this.removedLocalVariableNames != null && this.removedLocalVariableNames.size() > 0) {
            this.removedLocalVariableNames.clear();
        }

        this.setSelectionTarget = false;
        this.selectionTargetObject = null;

        this.setInliner = false;
        this.setInlinerValue = null;

        this.setTemplateData = false;
        this.setTemplateDataValue = null;

    }




    void applyContextModifications(final IEngineContext engineContext) {

        if (engineContext == null) {
            return;
        }

        if (this.setLocalVariable) {
            engineContext.setVariables(this.addedLocalVariables);
        }

        if (this.removeLocalVariable) {
            for (final String variableName : this.removedLocalVariableNames) {
                engineContext.removeVariable(variableName);
            }
        }

        if (this.setSelectionTarget) {
            engineContext.setSelectionTarget(this.selectionTargetObject);
        }

        if (this.setInliner) {
            engineContext.setInliner(this.setInlinerValue);
        }

        if (this.setTemplateData) {
            engineContext.setTemplateData(this.setTemplateDataValue);
        }

    }




}

        // Can be combined with others, no need to resetGathering
        this.setLocalVariable = true;
        if (this.addedLocalVariables == null) {
            this.addedLocalVariables = new HashMap<String, Object>(3);
        }
        this.addedLocalVariables.put(name, value);
    
<no_super_class>