aoqi@0: /* aoqi@0: * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. aoqi@0: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. aoqi@0: * aoqi@0: * This code is free software; you can redistribute it and/or modify it aoqi@0: * under the terms of the GNU General Public License version 2 only, as aoqi@0: * published by the Free Software Foundation. Oracle designates this aoqi@0: * particular file as subject to the "Classpath" exception as provided aoqi@0: * by Oracle in the LICENSE file that accompanied this code. aoqi@0: * aoqi@0: * This code is distributed in the hope that it will be useful, but WITHOUT aoqi@0: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or aoqi@0: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License aoqi@0: * version 2 for more details (a copy is included in the LICENSE file that aoqi@0: * accompanied this code). aoqi@0: * aoqi@0: * You should have received a copy of the GNU General Public License version aoqi@0: * 2 along with this work; if not, write to the Free Software Foundation, aoqi@0: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. aoqi@0: * aoqi@0: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA aoqi@0: * or visit www.oracle.com if you need additional information or have any aoqi@0: * questions. aoqi@0: */ aoqi@0: aoqi@0: package com.sun.xml.internal.ws.api.databinding; aoqi@0: aoqi@0: import java.net.URL; aoqi@0: import java.util.HashMap; aoqi@0: import java.util.HashSet; aoqi@0: import java.util.Set; aoqi@0: import java.util.Map; aoqi@0: aoqi@0: import javax.xml.transform.Source; aoqi@0: import javax.xml.ws.WebServiceFeature; aoqi@0: aoqi@0: import org.xml.sax.EntityResolver; aoqi@0: aoqi@0: import com.sun.xml.internal.ws.api.WSBinding; aoqi@0: import com.sun.xml.internal.ws.api.WSFeatureList; aoqi@0: import com.sun.xml.internal.ws.api.model.wsdl.WSDLPort; aoqi@0: import com.sun.xml.internal.ws.binding.WebServiceFeatureList; aoqi@0: aoqi@0: /** aoqi@0: * DatabindingConfig contains the initial states for Databinding. After a Databinding aoqi@0: * instance is created, all it's internal states should be considered aoqi@0: * 'immutable' and therefore the operations on Databinding are thread-safe. aoqi@0: * aoqi@0: * @author shih-chang.chen@oracle.com aoqi@0: */ aoqi@0: public class DatabindingConfig { aoqi@0: protected Class contractClass; aoqi@0: protected Class endpointClass; aoqi@0: protected Set additionalValueTypes = new HashSet(); aoqi@0: protected MappingInfo mappingInfo = new MappingInfo(); aoqi@0: protected URL wsdlURL; aoqi@0: protected ClassLoader classLoader; aoqi@0: protected Iterable features; aoqi@0: protected WSBinding wsBinding; aoqi@0: protected WSDLPort wsdlPort; aoqi@0: protected MetadataReader metadataReader; aoqi@0: protected Map properties = new HashMap(); aoqi@0: protected Source wsdlSource; aoqi@0: protected EntityResolver entityResolver; aoqi@0: aoqi@0: public Class getContractClass() { aoqi@0: return contractClass; aoqi@0: } aoqi@0: public void setContractClass(Class contractClass) { aoqi@0: this.contractClass = contractClass; aoqi@0: } aoqi@0: public Class getEndpointClass() { aoqi@0: return endpointClass; aoqi@0: } aoqi@0: public void setEndpointClass(Class implBeanClass) { aoqi@0: this.endpointClass = implBeanClass; aoqi@0: } aoqi@0: public MappingInfo getMappingInfo() { aoqi@0: return mappingInfo; aoqi@0: } aoqi@0: public void setMappingInfo(MappingInfo mappingInfo) { aoqi@0: this.mappingInfo = mappingInfo; aoqi@0: } aoqi@0: public URL getWsdlURL() { aoqi@0: return wsdlURL; aoqi@0: } aoqi@0: public void setWsdlURL(URL wsdlURL) { aoqi@0: this.wsdlURL = wsdlURL; aoqi@0: } aoqi@0: public ClassLoader getClassLoader() { aoqi@0: return classLoader; aoqi@0: } aoqi@0: public void setClassLoader(ClassLoader classLoader) { aoqi@0: this.classLoader = classLoader; aoqi@0: } aoqi@0: public Iterable getFeatures() { aoqi@0: if (features == null && wsBinding != null) return wsBinding.getFeatures(); aoqi@0: return features; aoqi@0: } aoqi@0: public void setFeatures(WebServiceFeature[] features) { aoqi@0: setFeatures(new WebServiceFeatureList(features)); aoqi@0: } aoqi@0: public void setFeatures(Iterable features) { aoqi@0: this.features = WebServiceFeatureList.toList(features); aoqi@0: } aoqi@0: public WSDLPort getWsdlPort() { aoqi@0: return wsdlPort; aoqi@0: } aoqi@0: public void setWsdlPort(WSDLPort wsdlPort) { aoqi@0: this.wsdlPort = wsdlPort; aoqi@0: } aoqi@0: public Set additionalValueTypes() { aoqi@0: return additionalValueTypes; aoqi@0: } aoqi@0: public Map properties() { aoqi@0: return properties; aoqi@0: } aoqi@0: public WSBinding getWSBinding() { aoqi@0: return wsBinding; aoqi@0: } aoqi@0: public void setWSBinding(WSBinding wsBinding) { aoqi@0: this.wsBinding = wsBinding; aoqi@0: } aoqi@0: public MetadataReader getMetadataReader() { aoqi@0: return metadataReader; aoqi@0: } aoqi@0: public void setMetadataReader(MetadataReader reader) { aoqi@0: this.metadataReader = reader; aoqi@0: } aoqi@0: aoqi@0: public Source getWsdlSource() { aoqi@0: return wsdlSource; aoqi@0: } aoqi@0: public void setWsdlSource(Source wsdlSource) { aoqi@0: this.wsdlSource = wsdlSource; aoqi@0: } aoqi@0: public EntityResolver getEntityResolver() { aoqi@0: return entityResolver; aoqi@0: } aoqi@0: public void setEntityResolver(EntityResolver entityResolver) { aoqi@0: this.entityResolver = entityResolver; aoqi@0: } aoqi@0: }