package be.iminds.ilabt.jfed.rspec.parser;

import javax.xml.namespace.QName;
import javax.xml.stream.Location;
import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;

/**
 * User: twalcari
 * Date: 10/6/2015
 * Time: 11:50
 */
public class SingleElementExtraXml implements ExtraXml {

    private final XMLEvent event;

    public SingleElementExtraXml(XMLEvent event) {
        this.event = event;
    }

    @Override
    public void writeEvents(XMLEventWriter w) throws XMLStreamException {
        w.add(event);
    }

    @Override
    public QName getStartElementName() {
        return null;
    }

    @Override
    public Location getLocation() {
        return event.getLocation();
    }
}
