in java/org/apache/jasper/JspC.java [302:427]
public void setArgs(String[] arg) throws JasperException {
args = arg;
String tok;
dieLevel = NO_DIE_LEVEL;
while ((tok = nextArg()) != null) {
if (tok.equals(SWITCH_VERBOSE)) {
verbose = true;
showSuccess = true;
listErrors = true;
} else if (tok.equals(SWITCH_OUTPUT_DIR)) {
tok = nextArg();
setOutputDir(tok);
} else if (tok.equals(SWITCH_PACKAGE_NAME)) {
targetPackage = nextArg();
} else if (tok.equals(SWITCH_COMPILE)) {
compile = true;
} else if (tok.equals(SWITCH_FAIL_FAST)) {
failFast = true;
} else if (tok.equals(SWITCH_CLASS_NAME)) {
targetClassName = nextArg();
} else if (tok.equals(SWITCH_URI_BASE)) {
uriBase = nextArg();
} else if (tok.equals(SWITCH_URI_ROOT)) {
setUriroot(nextArg());
} else if (tok.equals(SWITCH_FILE_WEBAPP)) {
setUriroot(nextArg());
} else if (tok.equals(SHOW_SUCCESS)) {
showSuccess = true;
} else if (tok.equals(LIST_ERRORS)) {
listErrors = true;
} else if (tok.equals(SWITCH_WEBAPP_INC)) {
webxmlFile = nextArg();
if (webxmlFile != null) {
webxmlLevel = INC_WEBXML;
}
} else if (tok.equals(SWITCH_WEBAPP_FRG)) {
webxmlFile = nextArg();
if (webxmlFile != null) {
webxmlLevel = FRG_WEBXML;
}
} else if (tok.equals(SWITCH_WEBAPP_XML)) {
webxmlFile = nextArg();
if (webxmlFile != null) {
webxmlLevel = ALL_WEBXML;
}
} else if (tok.equals(SWITCH_WEBAPP_XML_ENCODING)) {
setWebXmlEncoding(nextArg());
} else if (tok.equals(SWITCH_ADD_WEBAPP_XML_MAPPINGS)) {
setAddWebXmlMappings(true);
} else if (tok.equals(SWITCH_MAPPED)) {
mappedFile = true;
} else if (tok.equals(SWITCH_XPOWERED_BY)) {
xpoweredBy = true;
} else if (tok.equals(SWITCH_TRIM_SPACES)) {
tok = nextArg();
if (TrimSpacesOption.SINGLE.toString().equalsIgnoreCase(tok)) {
setTrimSpaces(TrimSpacesOption.SINGLE);
} else {
setTrimSpaces(TrimSpacesOption.TRUE);
argPos--;
}
} else if (tok.equals(SWITCH_CACHE)) {
tok = nextArg();
caching = !"false".equals(tok);
} else if (tok.equals(SWITCH_CLASSPATH)) {
setClassPath(nextArg());
} else if (tok.startsWith(SWITCH_DIE)) {
try {
dieLevel = Integer.parseInt(tok.substring(SWITCH_DIE.length()));
} catch (NumberFormatException nfe) {
dieLevel = DEFAULT_DIE_LEVEL;
}
} else if (tok.equals(SWITCH_HELP)) {
helpNeeded = true;
} else if (tok.equals(SWITCH_POOLING)) {
tok = nextArg();
poolingEnabled = !"false".equals(tok);
} else if (tok.equals(SWITCH_ENCODING)) {
setJavaEncoding(nextArg());
} else if (tok.equals(SWITCH_SOURCE)) {
setCompilerSourceVM(nextArg());
} else if (tok.equals(SWITCH_TARGET)) {
setCompilerTargetVM(nextArg());
} else if (tok.equals(SWITCH_SMAP)) {
smapSuppressed = false;
} else if (tok.equals(SWITCH_DUMP_SMAP)) {
smapDumped = true;
} else if (tok.equals(SWITCH_VALIDATE_TLD)) {
setValidateTld(true);
} else if (tok.equals(SWITCH_VALIDATE_XML)) {
setValidateXml(true);
} else if (tok.equals(SWITCH_NO_BLOCK_EXTERNAL)) {
setBlockExternal(false);
} else if (tok.equals(SWITCH_NO_STRICT_QUOTE_ESCAPING)) {
setStrictQuoteEscaping(false);
} else if (tok.equals(SWITCH_QUOTE_ATTRIBUTE_EL)) {
setQuoteAttributeEL(true);
} else if (tok.equals(SWITCH_NO_QUOTE_ATTRIBUTE_EL)) {
setQuoteAttributeEL(false);
} else if (tok.equals(SWITCH_THREAD_COUNT)) {
setThreadCount(nextArg());
} else if (tok.equals(SWITCH_USENONSTANDARD_TAG_OPTIMIZATIONS)) {
setUseNonstandardTagOptimizations(nextArg());
} else {
if (tok.startsWith("-")) {
throw new JasperException(Localizer.getMessage("jspc.error.unknownOption", tok));
}
if (!fullstop) {
argPos--;
}
// Start treating the rest as JSP Pages
break;
}
}
// Add all extra arguments to the list of files
while (true) {
String file = nextFile();
if (file == null) {
break;
}
pages.add(file);
}
}