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: /**
034: * The jsp-property-groupType is used to group a number of
035: * files so they can be given global property information.
036: * All files so described are deemed to be JSP files. The
037: * following additional properties can be described:
038: * <p/>
039: * - Control whether EL is ignored.
040: * - Control whether scripting elements are invalid.
041: * - Indicate pageEncoding information.
042: * - Indicate that a resource is a JSP document (XML).
043: * - Prelude and Coda automatic includes.
044: * - Control whether the character sequence #{ is allowed
045: * when used as a String literal.
046: * - Control whether template text containing only
047: * whitespaces must be removed from the response output.
048: */
049: @XmlAccessorType(XmlAccessType.FIELD)
050: @XmlType(name="jsp-property-groupType",propOrder={"descriptions","displayNames","icon","urlPattern","elIgnored","pageEncoding","scriptingInvalid","isXml","includePrelude","includeCoda","deferredSyntaxAllowedAsLiteral","trimDirectiveWhitespaces"})
051: public class JspPropertyGroup {
052:
053: @XmlTransient
054: protected TextMap description = new TextMap();
055: @XmlTransient
056: protected TextMap displayName = new TextMap();
057: @XmlElement(name="icon",required=true)
058: protected LocalCollection<Icon> icon = new LocalCollection<Icon>();
059:
060: @XmlElement(name="url-pattern",required=true)
061: protected List<String> urlPattern;
062: @XmlElement(name="el-ignored")
063: protected Boolean elIgnored;
064: @XmlElement(name="page-encoding")
065: protected String pageEncoding;
066: @XmlElement(name="scripting-invalid")
067: protected Boolean scriptingInvalid;
068: @XmlElement(name="is-xml")
069: protected Boolean isXml;
070: @XmlElement(name="include-prelude")
071: protected List<String> includePrelude;
072: @XmlElement(name="include-coda")
073: protected List<String> includeCoda;
074: @XmlElement(name="deferred-syntax-allowed-as-literal")
075: protected Boolean deferredSyntaxAllowedAsLiteral;
076: @XmlElement(name="trim-directive-whitespaces")
077: protected Boolean trimDirectiveWhitespaces;
078: @XmlAttribute
079: @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
080: @XmlID
081: protected String id;
082:
083: @XmlElement(name="description",required=true)
084: public Text[] getDescriptions() {
085: return description.toArray();
086: }
087:
088: public void setDescriptions(Text[] text) {
089: description.set(text);
090: }
091:
092: public String getDescription() {
093: return description.get();
094: }
095:
096: @XmlElement(name="display-name",required=true)
097: public Text[] getDisplayNames() {
098: return displayName.toArray();
099: }
100:
101: public void setDisplayNames(Text[] text) {
102: displayName.set(text);
103: }
104:
105: public String getDisplayName() {
106: return displayName.get();
107: }
108:
109: public Collection<Icon> getIcons() {
110: if (icon == null) {
111: icon = new LocalCollection<Icon>();
112: }
113: return icon;
114: }
115:
116: public Map<String, Icon> getIconMap() {
117: if (icon == null) {
118: icon = new LocalCollection<Icon>();
119: }
120: return icon.toMap();
121: }
122:
123: public Icon getIcon() {
124: return icon.getLocal();
125: }
126:
127: public List<String> getUrlPattern() {
128: if (urlPattern == null) {
129: urlPattern = new ArrayList<String>();
130: }
131: return this .urlPattern;
132: }
133:
134: public Boolean isElIgnored() {
135: return elIgnored;
136: }
137:
138: public void setElIgnored(Boolean value) {
139: this .elIgnored = value;
140: }
141:
142: public String getPageEncoding() {
143: return pageEncoding;
144: }
145:
146: public void setPageEncoding(String value) {
147: this .pageEncoding = value;
148: }
149:
150: public Boolean isScriptingInvalid() {
151: return scriptingInvalid;
152: }
153:
154: public void setScriptingInvalid(Boolean value) {
155: this .scriptingInvalid = value;
156: }
157:
158: public Boolean isIsXml() {
159: return isXml;
160: }
161:
162: public void setIsXml(Boolean value) {
163: this .isXml = value;
164: }
165:
166: public List<String> getIncludePrelude() {
167: if (includePrelude == null) {
168: includePrelude = new ArrayList<String>();
169: }
170: return this .includePrelude;
171: }
172:
173: public List<String> getIncludeCoda() {
174: if (includeCoda == null) {
175: includeCoda = new ArrayList<String>();
176: }
177: return this .includeCoda;
178: }
179:
180: public Boolean isDeferredSyntaxAllowedAsLiteral() {
181: return deferredSyntaxAllowedAsLiteral;
182: }
183:
184: public void setDeferredSyntaxAllowedAsLiteral(Boolean value) {
185: this .deferredSyntaxAllowedAsLiteral = value;
186: }
187:
188: public Boolean isTrimDirectiveWhitespaces() {
189: return trimDirectiveWhitespaces;
190: }
191:
192: public void setTrimDirectiveWhitespaces(Boolean value) {
193: this .trimDirectiveWhitespaces = value;
194: }
195:
196: public String getId() {
197: return id;
198: }
199:
200: public void setId(String value) {
201: this.id = value;
202: }
203:
204: }
|