package be.iminds.ilabt.jfed.groovy_dsl.helpers;

import be.iminds.ilabt.jfed.groovy_dsl.DSLEventWriter;
import be.iminds.ilabt.jfed.groovy_dsl.DSLStreamException;
import be.iminds.ilabt.jfed.groovy_dsl.events.DSLEvent;

import javax.xml.stream.XMLStreamException;

/**
 * User: twalcari
 * Date: 5/18/2015
 * Time: 10:56
 */
public abstract class DSLEventWriterDelegate implements DSLEventWriter {

    protected final DSLEventWriter out;

    public DSLEventWriterDelegate(DSLEventWriter out) {
        this.out = out;
    }

    @Override
    public void add(DSLEvent event) throws DSLStreamException {
        out.add(event);
    }

    @Override
    public void close() throws XMLStreamException {
        out.close();
    }

    @Override
    public void flush() throws XMLStreamException {
        out.flush();
    }
}
