org.milyn.delivery.java.XStreamXMLReader Maven / Gradle / Ivy
/*
Milyn - Copyright (C) 2006 - 2010
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License (version 2.1) as published by the Free Software
Foundation.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details:
http://www.gnu.org/licenses/lgpl.txt
*/
package org.milyn.delivery.java;
import com.thoughtworks.xstream.io.xml.SaxWriter;
import org.milyn.cdr.annotation.ConfigParam;
import org.milyn.cdr.SmooksConfigurationException;
import org.milyn.container.ExecutionContext;
import org.milyn.delivery.annotation.Initialize;
import org.milyn.payload.JavaSource;
import org.xml.sax.*;
import java.io.IOException;
import java.util.List;
/**
* XStream based {@link JavaXMLReader}.
*
* This is the default Java {@link XMLReader} for Smooks.
*
* @author [email protected]
*/
public class XStreamXMLReader implements JavaXMLReader {
@ConfigParam(defaultVal = "true")
private boolean includeEnclosingDocument = true;
private SaxWriter xstreamReader;
@Initialize
public void intialize() {
xstreamReader = new SaxWriter(includeEnclosingDocument);
}
public void setSourceObjects(List