001: /**
002: *
003: * Licensed to the Apache Software Foundation (ASF) under one or more
004: * contributor license agreements. See the NOTICE file distributed with
005: * this work for additional information regarding copyright ownership.
006: * The ASF licenses this file to You under the Apache License, Version 2.0
007: * (the "License"); you may not use this file except in compliance with
008: * the License. You may obtain a copy of the License at
009: *
010: * http://www.apache.org/licenses/LICENSE-2.0
011: *
012: * Unless required by applicable law or agreed to in writing, software
013: * distributed under the License is distributed on an "AS IS" BASIS,
014: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015: * See the License for the specific language governing permissions and
016: * limitations under the License.
017: */package org.apache.openejb.jee;
018:
019: import javax.xml.bind.annotation.XmlAccessType;
020: import javax.xml.bind.annotation.XmlAccessorType;
021: import javax.xml.bind.annotation.XmlAttribute;
022: import javax.xml.bind.annotation.XmlElement;
023: import javax.xml.bind.annotation.XmlID;
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: @XmlAccessorType(XmlAccessType.FIELD)
034: @XmlType(name="filterType",propOrder={"descriptions","displayNames","icon","filterName","filterClass","initParam"})
035: public class Filter {
036:
037: @XmlTransient
038: protected TextMap description = new TextMap();
039: @XmlTransient
040: protected TextMap displayName = new TextMap();
041: @XmlElement(name="icon",required=true)
042: protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
043:
044: @XmlElement(name="filter-name",required=true)
045: protected String filterName;
046: @XmlElement(name="filter-class",required=true)
047: protected String filterClass;
048: @XmlElement(name="init-param")
049: protected List<ParamValue> initParam;
050: @XmlAttribute
051: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
052: @XmlID
053: protected String id;
054:
055: @XmlElement(name="description",required=true)
056: public Text[] getDescriptions() {
057: return description.toArray();
058: }
059:
060: public void setDescriptions(Text[] text) {
061: description.set(text);
062: }
063:
064: public String getDescription() {
065: return description.get();
066: }
067:
068: @XmlElement(name="display-name",required=true)
069: public Text[] getDisplayNames() {
070: return displayName.toArray();
071: }
072:
073: public void setDisplayNames(Text[] text) {
074: displayName.set(text);
075: }
076:
077: public String getDisplayName() {
078: return displayName.get();
079: }
080:
081: public Collection<Icon> getIcons() {
082: if (icon == null) {
083: icon = new LocalCollection<Icon>();
084: }
085: return icon;
086: }
087:
088: public Map<String, Icon> getIconMap() {
089: if (icon == null) {
090: icon = new LocalCollection<Icon>();
091: }
092: return icon.toMap();
093: }
094:
095: public Icon getIcon() {
096: return icon.getLocal();
097: }
098:
099: public String getFilterName() {
100: return filterName;
101: }
102:
103: public void setFilterName(String value) {
104: this .filterName = value;
105: }
106:
107: public String getFilterClass() {
108: return filterClass;
109: }
110:
111: public void setFilterClass(String value) {
112: this .filterClass = value;
113: }
114:
115: public List<ParamValue> getInitParam() {
116: if (initParam == null) {
117: initParam = new ArrayList<ParamValue>();
118: }
119: return this .initParam;
120: }
121:
122: public String getId() {
123: return id;
124: }
125:
126: public void setId(String value) {
127: this.id = value;
128: }
129:
130: }
|