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.Collection;
029: import java.util.List;
030: import java.util.Map;
031:
032: /**
033: * Declares the handler for a port-component. Handlers can access the
034: * init-param name/value pairs using the HandlerInfo interface.
035: * <p/>
036: * Used in: port-component
037: */
038: @XmlAccessorType(XmlAccessType.FIELD)
039: @XmlType(name="port-component_handlerType",propOrder={"description","displayName","icon","handlerName","handlerClass","initParam","soapHeader","soapRole","portName"})
040: public class Handler {
041: protected List<String> description;
042: @XmlElement(name="display-name")
043: protected List<String> displayName;
044: @XmlElement(name="icon")
045: protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
046: @XmlElement(name="handler-name",required=true)
047: protected String handlerName;
048: @XmlElement(name="handler-class",required=true)
049: protected String handlerClass;
050: @XmlElement(name="init-param")
051: protected List<ParamValue> initParam;
052: @XmlElement(name="soap-header")
053: protected List<QName> soapHeader;
054: @XmlElement(name="soap-role")
055: protected List<String> soapRole;
056: // only used by service-refs
057: @XmlElement(name="port-name",required=true)
058: protected List<String> portName;
059: @XmlAttribute
060: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
061: @XmlID
062: protected String id;
063:
064: public List<String> getDescription() {
065: if (description == null) {
066: description = new ArrayList<String>();
067: }
068: return this .description;
069: }
070:
071: public List<String> getDisplayName() {
072: if (displayName == null) {
073: displayName = new ArrayList<String>();
074: }
075: return this .displayName;
076: }
077:
078: public Collection<Icon> getIcons() {
079: if (icon == null) {
080: icon = new LocalCollection<Icon>();
081: }
082: return icon;
083: }
084:
085: public Map<String, Icon> getIconMap() {
086: if (icon == null) {
087: icon = new LocalCollection<Icon>();
088: }
089: return icon.toMap();
090: }
091:
092: public Icon getIcon() {
093: return icon.getLocal();
094: }
095:
096: public String getHandlerName() {
097: return handlerName;
098: }
099:
100: public void setHandlerName(String value) {
101: this .handlerName = value;
102: }
103:
104: public String getHandlerClass() {
105: return handlerClass;
106: }
107:
108: public void setHandlerClass(String value) {
109: this .handlerClass = value;
110: }
111:
112: public List<ParamValue> getInitParam() {
113: if (initParam == null) {
114: initParam = new ArrayList<ParamValue>();
115: }
116: return this .initParam;
117: }
118:
119: public List<QName> getSoapHeader() {
120: if (soapHeader == null) {
121: soapHeader = new ArrayList<QName>();
122: }
123: return this .soapHeader;
124: }
125:
126: public List<String> getSoapRole() {
127: if (soapRole == null) {
128: soapRole = new ArrayList<String>();
129: }
130: return this .soapRole;
131: }
132:
133: public List<String> getPortName() {
134: if (portName == null) {
135: portName = new ArrayList<String>();
136: }
137: return this .portName;
138: }
139:
140: public String getId() {
141: return id;
142: }
143:
144: public void setId(String value) {
145: this.id = value;
146: }
147: }
|