Skip to content
Snippets Groups Projects
Commit 941b448d authored by Sören Henning's avatar Sören Henning
Browse files

removed deprecated classes

parent 4fd559b7
No related branches found
No related tags found
1 merge request!17Get impletemented stages and Java 8
Pipeline #
package kieker.analysis.util;
import java.io.OutputStream;
import javax.xml.bind.JAXBElement;
@Deprecated
public class JAXBMarshalElement<T> {
private JAXBElement<T> element;
private OutputStream outputStream;
public JAXBMarshalElement(final JAXBElement<T> element, final OutputStream outputStream) {
this.element = element;
this.outputStream = outputStream;
}
public JAXBElement<T> getElement() {
return element;
}
public void setElement(final JAXBElement<T> element) {
this.element = element;
}
public OutputStream getOutputStream() {
return outputStream;
}
public void setOutputStream(final OutputStream outputStream) {
this.outputStream = outputStream;
}
}
package kieker.analysis.util;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import teetime.framework.AbstractConsumerStage;
/**
* This stage marshals the content tree rooted at an incoming element into an
* output stream.
*
* A class object has to be passed at creation. Only elements of this type
* wrapped in a {@code JAXBElement} could be marshaled.
*
* Incoming elements must be {@code JAXBMarshalElement} which stores the
* {@code JAXBElement} and an output stream.
*
* @author Sören Henning
*
*/
@Deprecated
public class JAXBMarshalStageOld<T> extends AbstractConsumerStage<JAXBMarshalElement<T>> {
private static final Boolean FORMATTED_OUTPUT_DEFAULT = Boolean.TRUE;
private final Marshaller marshaller;
public JAXBMarshalStageOld(final Class<T> elementsClass) {
this(elementsClass, FORMATTED_OUTPUT_DEFAULT);
}
public JAXBMarshalStageOld(final Class<T> elementsClass, final Boolean formattedOutput) {
try {
this.marshaller = JAXBContext.newInstance(elementsClass).createMarshaller();
marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, formattedOutput);
} catch (JAXBException e) {
// TODO Exception
throw new IllegalStateException(e);
}
}
@Override
protected void execute(final JAXBMarshalElement<T> element) {
try {
marshaller.marshal(element.getElement(), element.getOutputStream());
} catch (JAXBException e) {
// TODO Exception
throw new IllegalStateException("The received element could not be marshalled.", e);
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment