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.XmlType;
024: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
025: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
026: import javax.xml.namespace.QName;
027: import java.util.ArrayList;
028: import java.util.List;
029:
030: /**
031: * The java-xml-type-mapping element contains a java-type that is the
032: * fully qualified name of the Java class, primitive type, or array
033: * type, QName of the XML root type or anonymous type, the WSDL type
034: * scope the QName applies to and the set of variable mappings for
035: * each public variable within the Java class.
036: * <p/>
037: * Used in: java-wsdl-mapping
038: */
039: @XmlAccessorType(XmlAccessType.FIELD)
040: @XmlType(name="java-xml-type-mappingType",propOrder={"javaType","rootTypeQname","anonymousTypeQname","qnameScope","variableMapping"})
041: public class JavaXmlTypeMapping {
042: @XmlElement(name="java-type",required=true)
043: protected String javaType;
044: @XmlElement(name="root-type-qname")
045: protected QName rootTypeQname;
046: @XmlElement(name="anonymous-type-qname")
047: protected String anonymousTypeQname;
048: @XmlElement(name="qname-scope",required=true)
049: protected String qnameScope;
050: @XmlElement(name="variable-mapping")
051: protected List<VariableMapping> variableMapping;
052: @XmlAttribute
053: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
054: @XmlID
055: protected String id;
056:
057: public String getJavaType() {
058: return javaType;
059: }
060:
061: public void setJavaType(String value) {
062: this .javaType = value;
063: }
064:
065: public QName getRootTypeQname() {
066: return rootTypeQname;
067: }
068:
069: public void setRootTypeQname(QName value) {
070: this .rootTypeQname = value;
071: }
072:
073: public String getAnonymousTypeQname() {
074: return anonymousTypeQname;
075: }
076:
077: public void setAnonymousTypeQname(String value) {
078: this .anonymousTypeQname = value;
079: }
080:
081: public String getQNameScope() {
082: return qnameScope;
083: }
084:
085: public void setQNameScope(String value) {
086: this .qnameScope = value;
087: }
088:
089: public boolean isElement() {
090: return "element".equals(qnameScope);
091: }
092:
093: public boolean isSimpleType() {
094: return "simpleType".equals(qnameScope);
095: }
096:
097: public List<VariableMapping> getVariableMapping() {
098: if (variableMapping == null) {
099: variableMapping = new ArrayList<VariableMapping>();
100: }
101: return this .variableMapping;
102: }
103:
104: public String getId() {
105: return id;
106: }
107:
108: public void setId(String value) {
109: this.id = value;
110: }
111: }
|