001: /**
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */package org.apache.openejb.jee;
017:
018: import javax.xml.bind.annotation.XmlAccessType;
019: import javax.xml.bind.annotation.XmlAccessorType;
020: import javax.xml.bind.annotation.XmlAttribute;
021: import javax.xml.bind.annotation.XmlElement;
022: import javax.xml.bind.annotation.XmlID;
023: import javax.xml.bind.annotation.XmlRootElement;
024: import javax.xml.bind.annotation.XmlType;
025: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
026: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027: import javax.xml.namespace.QName;
028: import java.util.ArrayList;
029: import java.util.Collection;
030: import java.util.List;
031: import java.util.Map;
032:
033: /**
034: * The element describes the Java mapping to a known WSDL document.
035: * <p/>
036: * It contains the mapping between package names and XML namespaces,
037: * WSDL root types and Java artifacts, and the set of mappings for
038: * services.
039: */
040: @XmlRootElement(name="java-wsdl-mapping")
041: @XmlAccessorType(XmlAccessType.FIELD)
042: @XmlType(name="java-wsdl-mappingType",propOrder={"packageMapping","javaXmlTypeMapping","exceptionMapping","serviceInterfaceMapping","serviceEndpointInterfaceMapping"})
043: public class JavaWsdlMapping {
044: @XmlElement(name="package-mapping",required=true)
045: protected KeyedCollection<String, PackageMapping> packageMapping;
046: @XmlElement(name="java-xml-type-mapping")
047: protected List<JavaXmlTypeMapping> javaXmlTypeMapping;
048: @XmlElement(name="exception-mapping")
049: protected KeyedCollection<QName, ExceptionMapping> exceptionMapping;
050: @XmlElement(name="service-interface-mapping")
051: protected List<ServiceInterfaceMapping> serviceInterfaceMapping;
052: @XmlElement(name="service-endpoint-interface-mapping")
053: protected KeyedCollection<String, ServiceEndpointInterfaceMapping> serviceEndpointInterfaceMapping;
054: @XmlAttribute
055: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
056: @XmlID
057: protected String id;
058: @XmlAttribute(required=true)
059: protected String version;
060:
061: public Collection<PackageMapping> getPackageMapping() {
062: if (packageMapping == null) {
063: packageMapping = new KeyedCollection<String, PackageMapping>();
064: }
065: return this .packageMapping;
066: }
067:
068: public Map<String, PackageMapping> getPackageMappingMap() {
069: if (packageMapping == null) {
070: packageMapping = new KeyedCollection<String, PackageMapping>();
071: }
072: return this .packageMapping.toMap();
073: }
074:
075: public List<JavaXmlTypeMapping> getJavaXmlTypeMapping() {
076: if (javaXmlTypeMapping == null) {
077: javaXmlTypeMapping = new ArrayList<JavaXmlTypeMapping>();
078: }
079: return this .javaXmlTypeMapping;
080: }
081:
082: public Collection<ExceptionMapping> getExceptionMapping() {
083: if (exceptionMapping == null) {
084: exceptionMapping = new KeyedCollection<QName, ExceptionMapping>();
085: }
086: return this .exceptionMapping;
087: }
088:
089: public Map<QName, ExceptionMapping> getExceptionMappingMap() {
090: if (exceptionMapping == null) {
091: exceptionMapping = new KeyedCollection<QName, ExceptionMapping>();
092: }
093: return this .exceptionMapping.toMap();
094: }
095:
096: public List<ServiceInterfaceMapping> getServiceInterfaceMapping() {
097: if (serviceInterfaceMapping == null) {
098: serviceInterfaceMapping = new ArrayList<ServiceInterfaceMapping>();
099: }
100: return this .serviceInterfaceMapping;
101: }
102:
103: public Collection<ServiceEndpointInterfaceMapping> getServiceEndpointInterfaceMapping() {
104: if (serviceEndpointInterfaceMapping == null) {
105: serviceEndpointInterfaceMapping = new KeyedCollection<String, ServiceEndpointInterfaceMapping>();
106: }
107: return this .serviceEndpointInterfaceMapping;
108: }
109:
110: public Map<String, ServiceEndpointInterfaceMapping> getServiceEndpointInterfaceMappingMap() {
111: if (serviceEndpointInterfaceMapping == null) {
112: serviceEndpointInterfaceMapping = new KeyedCollection<String, ServiceEndpointInterfaceMapping>();
113: }
114: return this .serviceEndpointInterfaceMapping.toMap();
115: }
116:
117: public String getId() {
118: return id;
119: }
120:
121: public void setId(String value) {
122: this .id = value;
123: }
124:
125: public String getVersion() {
126: if (version == null) {
127: return "1.1";
128: } else {
129: return version;
130: }
131: }
132:
133: public void setVersion(String value) {
134: this.version = value;
135: }
136: }
|