File: Options.java

package info (click to toggle)
tomcat9 9.0.111-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 47,852 kB
  • sloc: java: 381,732; xml: 70,399; jsp: 4,682; sh: 1,336; perl: 324; makefile: 18; ansic: 14
file content (262 lines) | stat: -rw-r--r-- 8,527 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.jasper;

import java.io.File;
import java.util.Map;

import javax.servlet.jsp.tagext.TagLibraryInfo;

import org.apache.jasper.compiler.JspConfig;
import org.apache.jasper.compiler.TagPluginManager;
import org.apache.jasper.compiler.TldCache;

/**
 * A class to hold all init parameters specific to the JSP engine.
 */
public interface Options {

    /**
     * Returns true if Jasper issues a compilation error instead of a runtime Instantiation error if the class attribute
     * specified in useBean action is invalid.
     *
     * @return <code>true</code> to get an error
     */
    boolean getErrorOnUseBeanInvalidClassAttribute();

    /**
     * @return <code>true</code> to keep the generated source
     */
    boolean getKeepGenerated();

    /**
     * @return <code>true</code> if tag handler pooling is enabled, <code>false</code> otherwise.
     */
    boolean isPoolingEnabled();

    /**
     * @return <code>true</code> if HTML mapped Servlets are supported.
     */
    boolean getMappedFile();

    /**
     * @return <code>true</code> if debug information in included in compiled classes.
     */
    boolean getClassDebugInfo();

    /**
     * @return background compile thread check interval in seconds
     */
    int getCheckInterval();

    /**
     * Main development flag, which enables detailed error reports with sources, as well automatic recompilation of JSPs
     * and tag files. This setting should usually be <code>false</code> when running in production.
     *
     * @return <code>true</code> if Jasper is in development mode
     */
    boolean getDevelopment();

    /**
     * @return <code>true</code> to include a source fragment in exception messages.
     */
    boolean getDisplaySourceFragment();

    /**
     * @return <code>true</code> to suppress generation of SMAP info for JSR45 debugging.
     */
    boolean isSmapSuppressed();

    /**
     * This setting is ignored if suppressSmap() is <code>true</code>.
     *
     * @return <code>true</code> to write SMAP info for JSR45 debugging to a file.
     */
    boolean isSmapDumped();

    /**
     * @return {@link TrimSpacesOption#TRUE} to remove template text that consists only of whitespace from the output
     *             completely, {@link TrimSpacesOption#SINGLE} to replace such template text with a single space,
     *             {@link TrimSpacesOption#FALSE} to leave such template text unchanged or
     *             {@link TrimSpacesOption#EXTENDED} to remove template text that consists only of whitespace and to
     *             replace any sequence of whitespace and new lines within template text with a single new line.
     */
    TrimSpacesOption getTrimSpaces();

    /**
     * Gets the class-id value that is sent to Internet Explorer when using &lt;jsp:plugin&gt; tags.
     *
     * @return Class-id value
     *
     * @deprecated Will be removed in Tomcat 10.1.x
     */
    @Deprecated
    String getIeClassId();

    /**
     * @return the work folder
     */
    File getScratchDir();

    /**
     * @return the classpath used to compile generated Servlets
     */
    String getClassPath();

    /**
     * Compiler to use.
     * <p>
     * If <code>null</code> (the default), the java compiler from Eclipse JDT project, bundled with Tomcat, will be
     * used. Otherwise, the <code>javac</code> task from Apache Ant will be used to call an external java compiler and
     * the value of this option will be passed to it. See Apache Ant documentation for the possible values.
     *
     * @return the compiler name
     */
    String getCompiler();

    /**
     * @return the compiler target VM, e.g. 1.8.
     */
    String getCompilerTargetVM();

    /**
     * @return the compiler source VM, e.g. 1.8.
     */
    String getCompilerSourceVM();

    /**
     * @return Jasper Java compiler class to use.
     */
    String getCompilerClassName();

    /**
     * The cache that maps URIs, resource paths and parsed TLD files for the various tag libraries 'exposed' by the web
     * application. A tag library is 'exposed' either explicitly in web.xml or implicitly via the uri tag in the TLD of
     * a taglib deployed in a jar file (WEB-INF/lib).
     *
     * @return the instance of the TldCache for the web-application.
     */
    TldCache getTldCache();

    /**
     * @return Java platform encoding to generate the JSP page servlet.
     */
    String getJavaEncoding();

    /**
     * The boolean flag to tell Ant whether to fork JSP page compilations.
     * <p>
     * Is used only when Jasper uses an external java compiler (wrapped through a <code>javac</code> Apache Ant task).
     *
     * @return <code>true</code> to fork a process during compilation
     */
    boolean getFork();

    /**
     * @return JSP configuration information specified in web.xml.
     */
    JspConfig getJspConfig();

    /**
     * @return <code>true</code> to generate a X-Powered-By response header.
     */
    boolean isXpoweredBy();

    /**
     * @return a Tag Plugin Manager
     */
    TagPluginManager getTagPluginManager();

    /**
     * Indicates whether text strings are to be generated as char arrays.
     *
     * @return <code>true</code> if text strings are to be generated as char arrays, <code>false</code> otherwise
     */
    boolean genStringAsCharArray();

    /**
     * @return modification test interval.
     */
    int getModificationTestInterval();


    /**
     * @return <code>true</code> if re-compile will occur on a failure.
     */
    boolean getRecompileOnFail();

    /**
     * @return <code>true</code> is caching is enabled (used for precompilation).
     */
    boolean isCaching();

    /**
     * The web-application wide cache for the TagLibraryInfo tag library descriptors, used if {@link #isCaching()}
     * returns <code>true</code>.
     * <p>
     * Using this cache avoids the cost of repeating the parsing of a tag library descriptor XML file (performed by
     * TagLibraryInfoImpl.parseTLD).
     * </p>
     *
     * @return the Map(String uri, TagLibraryInfo tld) instance.
     */
    Map<String,TagLibraryInfo> getCache();

    /**
     * The maximum number of loaded jsps per web-application. If there are more jsps loaded, they will be unloaded. If
     * unset or less than 0, no jsps are unloaded.
     *
     * @return The JSP count
     */
    int getMaxLoadedJsps();

    /**
     * @return the idle time in seconds after which a JSP is unloaded. If unset or less or equal than 0, no jsps are
     *             unloaded.
     */
    int getJspIdleTimeout();

    /**
     * @return {@code true} if the quote escaping required by section JSP.1.6 of the JSP specification should be applied
     *             to scriplet expression.
     */
    boolean getStrictQuoteEscaping();

    /**
     * @return {@code true} if EL expressions used within attributes should have the quoting rules in JSP.1.6 applied to
     *             the expression.
     */
    boolean getQuoteAttributeEL();

    /**
     * Should the container include the time the file was generated in the comments at the start of a Java file
     * generated from a JSP or tag. Defaults to {@code true}.
     *
     * @return {@code true} to include the timestamp, otherwise don't include it
     */
    default boolean getGeneratedJavaAddTimestamp() {
        return true;
    }

    /**
     * A string containing a comma-separated list of names to which custom tag implementations should be applied.
     * Unknown or unused tag entries are harmless. Generally defined via an init parameter on the JspServlet.
     *
     * @return which tags to use
     */
    String getUseNonstandardTagOptimizations();
}