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.XmlTransient;
025: import javax.xml.bind.annotation.XmlType;
026: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
027: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
028: import java.util.Collection;
029: import java.util.Map;
030:
031: /**
032: * The connectorType defines a resource adapter.
033: */
034: @XmlRootElement(name="connector")
035: @XmlAccessorType(XmlAccessType.FIELD)
036: @XmlType(name="connectorType",propOrder={"descriptions","displayNames","icon","vendorName","eisType","resourceAdapterVersion","license","resourceAdapter"})
037: public class Connector {
038:
039: @XmlTransient
040: protected TextMap description = new TextMap();
041: @XmlTransient
042: protected TextMap displayName = new TextMap();
043: @XmlElement(name="icon",required=true)
044: protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
045:
046: @XmlElement(name="vendor-name",required=true)
047: protected String vendorName;
048: @XmlElement(name="eis-type",required=true)
049: protected String eisType;
050: @XmlElement(name="resourceadapter-version",required=true)
051: protected String resourceAdapterVersion;
052: protected License license;
053: @XmlElement(name="resourceadapter",required=true)
054: protected ResourceAdapter resourceAdapter;
055: @XmlAttribute
056: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
057: @XmlID
058: protected String id;
059: @XmlAttribute(required=true)
060: protected String version;
061:
062: @XmlElement(name="description",required=true)
063: public Text[] getDescriptions() {
064: return description.toArray();
065: }
066:
067: public void setDescriptions(Text[] text) {
068: description.set(text);
069: }
070:
071: public String getDescription() {
072: return description.get();
073: }
074:
075: @XmlElement(name="display-name",required=true)
076: public Text[] getDisplayNames() {
077: return displayName.toArray();
078: }
079:
080: public void setDisplayNames(Text[] text) {
081: displayName.set(text);
082: }
083:
084: public String getDisplayName() {
085: return displayName.get();
086: }
087:
088: public Collection<Icon> getIcons() {
089: if (icon == null) {
090: icon = new LocalCollection<Icon>();
091: }
092: return icon;
093: }
094:
095: public Map<String, Icon> getIconMap() {
096: if (icon == null) {
097: icon = new LocalCollection<Icon>();
098: }
099: return icon.toMap();
100: }
101:
102: public Icon getIcon() {
103: return icon.getLocal();
104: }
105:
106: public String getVendorName() {
107: return vendorName;
108: }
109:
110: public void setVendorName(String value) {
111: this .vendorName = value;
112: }
113:
114: public String getEisType() {
115: return eisType;
116: }
117:
118: public void setEisType(String value) {
119: this .eisType = value;
120: }
121:
122: public String getResourceAdapterVersion() {
123: return resourceAdapterVersion;
124: }
125:
126: public void setResourceAdapterVersion(String value) {
127: this .resourceAdapterVersion = value;
128: }
129:
130: public License getLicense() {
131: return license;
132: }
133:
134: public void setLicense(License value) {
135: this .license = value;
136: }
137:
138: public ResourceAdapter getResourceAdapter() {
139: return resourceAdapter;
140: }
141:
142: public void setResourceAdapter(ResourceAdapter value) {
143: this .resourceAdapter = value;
144: }
145:
146: public String getId() {
147: return id;
148: }
149:
150: public void setId(String value) {
151: this .id = value;
152: }
153:
154: public String getVersion() {
155: if (version == null) {
156: return "1.5";
157: } else {
158: return version;
159: }
160: }
161:
162: public void setVersion(String value) {
163: this.version = value;
164: }
165:
166: }
|