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.XmlRootElement;
025: import javax.xml.bind.annotation.adapters.CollapsedStringAdapter;
026: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
027: import java.util.ArrayList;
028: import java.util.Collection;
029: import java.util.List;
030: import java.util.Map;
031:
032: @XmlRootElement(name="webservices")
033: @XmlAccessorType(XmlAccessType.FIELD)
034: @XmlType(name="webservicesType",propOrder={"description","displayName","icon","webserviceDescription"})
035: public class Webservices {
036: protected List<String> description;
037: @XmlElement(name="display-name")
038: protected List<String> displayName;
039: @XmlElement(name="icon")
040: protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
041: @XmlElement(name="webservice-description",required=true)
042: protected KeyedCollection<String, WebserviceDescription> webserviceDescription;
043: @XmlAttribute
044: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
045: @XmlID
046: protected String id;
047: @XmlAttribute(required=true)
048: protected String version;
049:
050: public List<String> getDescription() {
051: if (description == null) {
052: description = new ArrayList<String>();
053: }
054: return this .description;
055: }
056:
057: public List<String> getDisplayName() {
058: if (displayName == null) {
059: displayName = new ArrayList<String>();
060: }
061: return this .displayName;
062: }
063:
064: public Collection<Icon> getIcons() {
065: if (icon == null) {
066: icon = new LocalCollection<Icon>();
067: }
068: return icon;
069: }
070:
071: public Map<String, Icon> getIconMap() {
072: if (icon == null) {
073: icon = new LocalCollection<Icon>();
074: }
075: return icon.toMap();
076: }
077:
078: public Icon getIcon() {
079: return icon.getLocal();
080: }
081:
082: public Collection<WebserviceDescription> getWebserviceDescription() {
083: if (webserviceDescription == null) {
084: webserviceDescription = new KeyedCollection<String, WebserviceDescription>();
085: }
086: return this .webserviceDescription;
087: }
088:
089: public Map<String, WebserviceDescription> getWebserviceDescriptionMap() {
090: if (webserviceDescription == null) {
091: webserviceDescription = new KeyedCollection<String, WebserviceDescription>();
092: }
093: return webserviceDescription.toMap();
094: }
095:
096: public String getId() {
097: return id;
098: }
099:
100: public void setId(String value) {
101: this .id = value;
102: }
103:
104: public String getVersion() {
105: if (version == null) {
106: return "1.2";
107: } else {
108: return version;
109: }
110: }
111:
112: public void setVersion(String value) {
113: this.version = value;
114: }
115: }
|