org.apache.camel.converter.jaxp.XmlConverterLoader Maven / Gradle / Ivy
The newest version!
/* Generated by org.apache.camel:apt */
package org.apache.camel.converter.jaxp;
import org.apache.camel.Exchange;
import org.apache.camel.TypeConversionException;
import org.apache.camel.TypeConverterLoaderException;
import org.apache.camel.spi.TypeConverterLoader;
import org.apache.camel.spi.TypeConverterRegistry;
import org.apache.camel.support.SimpleTypeConverter;
import org.apache.camel.support.TypeConverterSupport;
import org.apache.camel.util.DoubleMap;
/**
* Source code generated by org.apache.camel:apt
*/
@SuppressWarnings("unchecked")
public final class XmlConverterLoader implements TypeConverterLoader {
public XmlConverterLoader() {
}
@Override
public void load(TypeConverterRegistry registry) throws TypeConverterLoaderException {
registerConverters(registry);
}
private void registerConverters(TypeConverterRegistry registry) {
addTypeConverter(registry, byte[].class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toByteArray((javax.xml.transform.Source) value, exchange));
addTypeConverter(registry, java.io.InputStream.class, javax.xml.transform.dom.DOMSource.class, false,
(type, exchange, value) -> getXmlConverter().toInputStream((javax.xml.transform.dom.DOMSource) value, exchange));
addTypeConverter(registry, java.io.InputStream.class, org.w3c.dom.Document.class, false,
(type, exchange, value) -> getXmlConverter().toInputStream((org.w3c.dom.Document) value, exchange));
addTypeConverter(registry, java.io.Reader.class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toReaderFromSource((javax.xml.transform.Source) value, exchange));
addTypeConverter(registry, java.lang.Boolean.class, org.w3c.dom.NodeList.class, false,
(type, exchange, value) -> getXmlConverter().toBoolean((org.w3c.dom.NodeList) value));
addTypeConverter(registry, java.lang.String.class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toString((javax.xml.transform.Source) value, exchange));
addTypeConverter(registry, java.lang.String.class, org.w3c.dom.Node.class, false,
(type, exchange, value) -> getXmlConverter().toString((org.w3c.dom.Node) value, exchange));
addTypeConverter(registry, javax.xml.transform.Source.class, java.lang.String.class, false,
(type, exchange, value) -> getXmlConverter().toSource((java.lang.String) value));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, byte[].class, false,
(type, exchange, value) -> getXmlConverter().toDOMSource((byte[]) value));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, java.io.File.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSource((java.io.File) value, exchange));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, java.io.InputStream.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSource((java.io.InputStream) value, exchange));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, java.lang.String.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSource((java.lang.String) value));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, javax.xml.transform.sax.SAXSource.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSourceFromSAX((javax.xml.transform.sax.SAXSource) value));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, javax.xml.transform.stax.StAXSource.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSourceFromStAX((javax.xml.transform.stax.StAXSource) value));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, javax.xml.transform.stream.StreamSource.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSourceFromStream((javax.xml.transform.stream.StreamSource) value, exchange));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSource((javax.xml.transform.Source) value, exchange));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, org.w3c.dom.Document.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSource((org.w3c.dom.Document) value));
addTypeConverter(registry, javax.xml.transform.dom.DOMSource.class, org.w3c.dom.Node.class, false,
(type, exchange, value) -> getXmlConverter().toDOMSource((org.w3c.dom.Node) value));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, byte[].class, false,
(type, exchange, value) -> getXmlConverter().toSAXSource((byte[]) value, exchange));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, java.io.File.class, false,
(type, exchange, value) -> getXmlConverter().toSAXSource((java.io.File) value, exchange));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, java.io.InputStream.class, false,
(type, exchange, value) -> getXmlConverter().toSAXSource((java.io.InputStream) value, exchange));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, java.lang.String.class, false,
(type, exchange, value) -> getXmlConverter().toSAXSource((java.lang.String) value, exchange));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, javax.xml.transform.dom.DOMSource.class, false,
(type, exchange, value) -> getXmlConverter().toSAXSourceFromDOM((javax.xml.transform.dom.DOMSource) value, exchange));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, javax.xml.transform.stax.StAXSource.class, false,
(type, exchange, value) -> getXmlConverter().toSAXSourceFromStAX((javax.xml.transform.stax.StAXSource) value, exchange));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, javax.xml.transform.stream.StreamSource.class, false,
(type, exchange, value) -> getXmlConverter().toSAXSourceFromStream((javax.xml.transform.stream.StreamSource) value, exchange));
addTypeConverter(registry, javax.xml.transform.sax.SAXSource.class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toSAXSource((javax.xml.transform.Source) value, exchange));
addTypeConverter(registry, javax.xml.transform.stax.StAXSource.class, byte[].class, false,
(type, exchange, value) -> getXmlConverter().toStAXSource((byte[]) value, exchange));
addTypeConverter(registry, javax.xml.transform.stax.StAXSource.class, java.io.File.class, false,
(type, exchange, value) -> getXmlConverter().toStAXSource((java.io.File) value, exchange));
addTypeConverter(registry, javax.xml.transform.stax.StAXSource.class, java.io.InputStream.class, false,
(type, exchange, value) -> getXmlConverter().toStAXSource((java.io.InputStream) value, exchange));
addTypeConverter(registry, javax.xml.transform.stax.StAXSource.class, java.lang.String.class, false,
(type, exchange, value) -> getXmlConverter().toStAXSource((java.lang.String) value, exchange));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, byte[].class, false,
(type, exchange, value) -> getXmlConverter().toStreamSource((byte[]) value, exchange));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, java.io.File.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSource((java.io.File) value));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, java.io.InputStream.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSource((java.io.InputStream) value));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, java.io.Reader.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSource((java.io.Reader) value));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, java.nio.ByteBuffer.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSource((java.nio.ByteBuffer) value, exchange));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, javax.xml.transform.dom.DOMSource.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSourceFromDOM((javax.xml.transform.dom.DOMSource) value, exchange));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, javax.xml.transform.sax.SAXSource.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSourceFromSAX((javax.xml.transform.sax.SAXSource) value, exchange));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, javax.xml.transform.stax.StAXSource.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSourceFromStAX((javax.xml.transform.stax.StAXSource) value, exchange));
addTypeConverter(registry, javax.xml.transform.stream.StreamSource.class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toStreamSource((javax.xml.transform.Source) value, exchange));
addTypeConverter(registry, org.apache.camel.util.xml.BytesSource.class, byte[].class, false,
(type, exchange, value) -> getXmlConverter().toBytesSource((byte[]) value));
addTypeConverter(registry, org.apache.camel.util.xml.StringSource.class, java.lang.String.class, false,
(type, exchange, value) -> getXmlConverter().toStringSource((java.lang.String) value));
addTypeConverter(registry, org.w3c.dom.Document.class, byte[].class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((byte[]) value, exchange));
addTypeConverter(registry, org.w3c.dom.Document.class, java.io.File.class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((java.io.File) value, exchange));
addTypeConverter(registry, org.w3c.dom.Document.class, java.io.InputStream.class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((java.io.InputStream) value, exchange));
addTypeConverter(registry, org.w3c.dom.Document.class, java.io.Reader.class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((java.io.Reader) value, exchange));
addTypeConverter(registry, org.w3c.dom.Document.class, java.lang.String.class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((java.lang.String) value, exchange));
addTypeConverter(registry, org.w3c.dom.Document.class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((javax.xml.transform.Source) value));
addTypeConverter(registry, org.w3c.dom.Document.class, org.w3c.dom.Node.class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((org.w3c.dom.Node) value));
addTypeConverter(registry, org.w3c.dom.Document.class, org.w3c.dom.NodeList.class, true,
(type, exchange, value) -> getXmlConverter().toDOMDocumentFromSingleNodeList((org.w3c.dom.NodeList) value));
addTypeConverter(registry, org.w3c.dom.Document.class, org.xml.sax.InputSource.class, false,
(type, exchange, value) -> getXmlConverter().toDOMDocument((org.xml.sax.InputSource) value, exchange));
addTypeConverter(registry, org.w3c.dom.Element.class, javax.xml.transform.Source.class, false,
(type, exchange, value) -> getXmlConverter().toDOMElement((javax.xml.transform.Source) value));
addTypeConverter(registry, org.w3c.dom.Element.class, org.w3c.dom.Node.class, false,
(type, exchange, value) -> getXmlConverter().toDOMElement((org.w3c.dom.Node) value));
addTypeConverter(registry, org.w3c.dom.Node.class, javax.xml.transform.sax.SAXSource.class, false,
(type, exchange, value) -> getXmlConverter().toDOMNodeFromSAX((javax.xml.transform.sax.SAXSource) value));
addTypeConverter(registry, org.w3c.dom.Node.class, javax.xml.transform.stax.StAXSource.class, false,
(type, exchange, value) -> getXmlConverter().toDOMNodeFromStAX((javax.xml.transform.stax.StAXSource) value));
addTypeConverter(registry, org.w3c.dom.Node.class, javax.xml.transform.Source.class, true,
(type, exchange, value) -> getXmlConverter().toDOMNode((javax.xml.transform.Source) value));
addTypeConverter(registry, org.w3c.dom.Node.class, org.w3c.dom.NodeList.class, true,
(type, exchange, value) -> getXmlConverter().toDOMNodeFromSingleNodeList((org.w3c.dom.NodeList) value));
addTypeConverter(registry, org.xml.sax.InputSource.class, java.io.File.class, false,
(type, exchange, value) -> getXmlConverter().toInputSource((java.io.File) value, exchange));
addTypeConverter(registry, org.xml.sax.InputSource.class, java.io.InputStream.class, false,
(type, exchange, value) -> getXmlConverter().toInputSource((java.io.InputStream) value, exchange));
}
private static void addTypeConverter(TypeConverterRegistry registry, Class> toType, Class> fromType, boolean allowNull, SimpleTypeConverter.ConversionMethod method) {
registry.addTypeConverter(toType, fromType, new SimpleTypeConverter(allowNull, method));
}
private volatile org.apache.camel.converter.jaxp.XmlConverter xmlConverter;
private org.apache.camel.converter.jaxp.XmlConverter getXmlConverter() {
if (xmlConverter == null) {
xmlConverter = new org.apache.camel.converter.jaxp.XmlConverter();
}
return xmlConverter;
}
}