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.ArrayList;
029: import java.util.List;
030: import java.util.Collection;
031: import java.util.Map;
032:
033: @XmlRootElement(name="application")
034: @XmlAccessorType(XmlAccessType.FIELD)
035: @XmlType(name="applicationType",propOrder={"descriptions","displayNames","icon","module","securityRole","libraryDirectory"})
036: public class Application {
037:
038: @XmlTransient
039: protected TextMap description = new TextMap();
040: @XmlTransient
041: protected TextMap displayName = new TextMap();
042: @XmlElement(name="icon",required=true)
043: protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
044:
045: @XmlElement(required=true)
046: protected List<Module> module;
047:
048: @XmlElement(name="security-role")
049: protected List<SecurityRole> securityRole;
050:
051: @XmlElement(name="library-directory")
052: protected String libraryDirectory;
053:
054: @XmlAttribute
055: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
056: @XmlID
057: protected java.lang.String id;
058: @XmlAttribute(required=true)
059: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
060: protected java.lang.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 getId() {
107: return id;
108: }
109:
110: public void setId(String id) {
111: this .id = id;
112: }
113:
114: public String getLibraryDirectory() {
115: return libraryDirectory;
116: }
117:
118: public void setLibraryDirectory(String libraryDirectory) {
119: this .libraryDirectory = libraryDirectory;
120: }
121:
122: public List<Module> getModule() {
123: if (module == null) {
124: module = new ArrayList<Module>();
125: }
126: return this .module;
127: }
128:
129: public void setModule(List<Module> module) {
130: this .module = module;
131: }
132:
133: public List<SecurityRole> getSecurityRole() {
134: if (securityRole == null) {
135: securityRole = new ArrayList<SecurityRole>();
136: }
137: return this .securityRole;
138: }
139:
140: public void setSecurityRole(List<SecurityRole> securityRole) {
141: this .securityRole = securityRole;
142: }
143:
144: public String getVersion() {
145: return version;
146: }
147:
148: public void setVersion(String version) {
149: this.version = version;
150: }
151: }
|