Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.cxf.jaxb;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.JAXBException;
import javax.xml.bind.Marshaller;
import javax.xml.bind.Unmarshaller;
import javax.xml.bind.ValidationEventHandler;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.namespace.QName;
import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLEventWriter;
import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import javax.xml.transform.dom.DOMResult;
import javax.xml.transform.dom.DOMSource;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.apache.cxf.common.injection.NoJSR250Annotations;
import org.apache.cxf.common.logging.LogUtils;
import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList;
import org.apache.cxf.common.util.PackageUtils;
import org.apache.cxf.common.xmlschema.SchemaCollection;
import org.apache.cxf.databinding.AbstractDataBinding;
import org.apache.cxf.databinding.AbstractWrapperHelper;
import org.apache.cxf.databinding.DataReader;
import org.apache.cxf.databinding.DataWriter;
import org.apache.cxf.databinding.WrapperCapableDatabinding;
import org.apache.cxf.databinding.WrapperHelper;
import org.apache.cxf.helpers.XMLUtils;
import org.apache.cxf.interceptor.Interceptor;
import org.apache.cxf.interceptor.InterceptorProvider;
import org.apache.cxf.jaxb.JAXBContextCache.CachedContextAndSchemas;
import org.apache.cxf.jaxb.attachment.JAXBAttachmentSchemaValidationHack;
import org.apache.cxf.jaxb.io.DataReaderImpl;
import org.apache.cxf.jaxb.io.DataWriterImpl;
import org.apache.cxf.message.Message;
import org.apache.cxf.resource.URIResolver;
import org.apache.cxf.service.Service;
import org.apache.cxf.service.factory.ServiceConstructionException;
import org.apache.cxf.service.model.ServiceInfo;
import org.apache.cxf.ws.addressing.ObjectFactory;
@NoJSR250Annotations
public class JAXBDataBinding extends AbstractDataBinding
implements WrapperCapableDatabinding, InterceptorProvider {
public static final String SCHEMA_RESOURCE = "SCHEMRESOURCE";
public static final String MTOM_THRESHOLD = "org.apache.cxf.jaxb.mtomThreshold";
public static final String UNWRAP_JAXB_ELEMENT = "unwrap.jaxb.element";
public static final String USE_JAXB_BRIDGE = "use.jaxb.bridge";
private static final Logger LOG = LogUtils.getLogger(JAXBDataBinding.class);
private static final Class SUPPORTED_READER_FORMATS[] = new Class[] {Node.class,
XMLEventReader.class,
XMLStreamReader.class};
private static final Class SUPPORTED_WRITER_FORMATS[] = new Class[] {OutputStream.class,
Node.class,
XMLEventWriter.class,
XMLStreamWriter.class};
private static final Map BUILT_IN_SCHEMAS = new HashMap();
static {
URIResolver resolver = new URIResolver();
try {
resolver.resolve("", "classpath:/schemas/wsdl/ws-addr-wsdl.xsd", JAXBDataBinding.class);
if (resolver.isResolved()) {
InputStream ins = resolver.getInputStream();
Document doc = XMLUtils.parse(ins);
ins.close();
DOMResult dr = new DOMResult(doc, "classpath:/schemas/wsdl/ws-addr-wsdl.xsd");
BUILT_IN_SCHEMAS.put("http://www.w3.org/2005/02/addressing/wsdl", dr);
resolver.unresolve();
}
} catch (Exception e) {
//IGNORE
}
try {
resolver.resolve("", "classpath:/schemas/wsdl/ws-addr.xsd", JAXBDataBinding.class);
if (resolver.isResolved()) {
InputStream ins = resolver.getInputStream();
Document doc = XMLUtils.parse(ins);
ins.close();
DOMResult dr = new DOMResult(doc, "classpath:/schemas/wsdl/ws-addr.xsd");
BUILT_IN_SCHEMAS.put("http://www.w3.org/2005/08/addressing", dr);
resolver.unresolve();
}
} catch (Exception e) {
//IGNORE
}
try {
resolver.resolve("", "classpath:/schemas/wsdl/wsrm.xsd", JAXBDataBinding.class);
if (resolver.isResolved()) {
InputStream ins = resolver.getInputStream();
Document doc = XMLUtils.parse(ins);
ins.close();
DOMResult dr = new DOMResult(doc, "classpath:/schemas/wsdl/wsrm.xsd");
BUILT_IN_SCHEMAS.put("http://schemas.xmlsoap.org/ws/2005/02/rm", dr);
resolver.unresolve();
}
} catch (Exception e) {
//IGNORE
}
try {
resolver.resolve("", "classpath:/schemas/wsdl/wsrm.xsd", JAXBDataBinding.class);
if (resolver.isResolved()) {
InputStream ins = resolver.getInputStream();
Document doc = XMLUtils.parse(ins);
ins.close();
DOMResult dr = new DOMResult(doc, "classpath:/schemas/wsdl/wsrm.xsd");
BUILT_IN_SCHEMAS.put("http://schemas.xmlsoap.org/ws/2005/02/rm", dr);
resolver.unresolve();
}
} catch (Exception e) {
//IGNORE
}
}
Class[] extraClass;
JAXBContext context;
Set> contextClasses;
Collection