| Method from org.apache.jasper.compiler.JspParseEventListener Detail: |
final void addGenerator(Generator gen) throws JasperException {
gen.init(ctxt);
generators.addElement(gen);
}
|
public void beginPageProcessing() throws JasperException {
for(int i = 0; i < Constants.STANDARD_IMPORTS.length; i++)
imports.addElement(Constants.STANDARD_IMPORTS[i]);
}
|
public void endPageProcessing() throws JasperException {
generateHeader();
writer.println();
generateAll(ServiceMethodPhase.class);
writer.println();
generateFooter();
if (ctxt.getOptions().largeFile())
try {
ObjectOutputStream o
= new ObjectOutputStream(new FileOutputStream(dataFile));
/*
* Serialize an array of char[]'s instead of an
* array of String's because there is a limitation
* on the size of Strings that can be serialized.
*/
char[][] tempCharArray = new char[vector.size()][];
vector.copyInto(tempCharArray);
o.writeObject(tempCharArray);
o.close();
writer.close();
} catch (IOException ex) {
throw new JasperException(Constants.getString(
"jsp.error.data.file.write"), ex);
}
ctxt.setContentType(servletContentType);
}
|
public TagLibraries getTagLibraries() {
return libraries;
}
|
public void handleBean(Mark start,
Mark stop,
Hashtable attrs) throws JasperException {
Generator gen
= new GeneratorWrapper(new BeanGenerator(start, attrs, beanInfo,
genSessionVariable),
start, stop);
addGenerator(gen);
}
|
public void handleBeanEnd(Mark start,
Mark stop,
Hashtable attrs) throws JasperException {
Generator gen
= new GeneratorWrapper(new BeanEndGenerator(),
start, stop);
// End the block started by useBean body.
addGenerator(gen);
}
|
public void handleCharData(char[] chars) throws JasperException {
GeneratorBase cdg;
if (ctxt.getOptions().largeFile())
cdg = new StoredCharDataGenerator(vector, dataFile, stringId++, chars);
else
cdg = new CharDataGenerator(chars);
// FIXME: change null
Generator gen
= new GeneratorWrapper(cdg,
null, null);
addGenerator(gen);
}
|
public void handleComment(Mark start,
Mark stop) throws JasperException {
Constants.message("jsp.message.htmlcomment",
new Object[] { reader.getChars(start, stop) },
Constants.HIGH_VERBOSITY);
}
|
public void handleDeclaration(Mark start,
Mark stop) throws JasperException {
Generator gen
= new GeneratorWrapper(new DeclarationGenerator(reader.getChars(
start, stop)), start, stop);
addGenerator(gen);
}
|
public void handleDirective(String directive,
Mark start,
Mark stop,
Hashtable attrs) throws JasperException {
Constants.message("jsp.message.handling_directive",
new Object[] { directive, attrs },
Constants.HIGH_VERBOSITY);
if (directive.equals("page")) {
Enumeration e = attrs.keys();
String attr;
while (e.hasMoreElements()) {
attr = (String) e.nextElement();
for(int i = 0; i < pdhis.length; i++) {
PageDirectiveHandlerInfo pdhi = pdhis[i];
if (attr.equals(pdhi.attribute)) {
String value = (String) attrs.get(pdhi.attribute);
pdhi.handler.handlePageDirectiveAttribute(this, value,
start, stop);
}
}
}
}
// Do some validations...
if (bufferSize == 0 && autoFlush == false)
throw new JasperException(Constants.getString(
"jsp.error.page.bad_b_and_a_combo"));
if (directive.equals("taglib")) {
String uri = (String) attrs.get("uri");
String prefix = (String) attrs.get("prefix");
try {
TagLibraryInfoImpl tl = new TagLibraryInfoImpl(ctxt,
prefix,
uri);
libraries.addTagLibrary(prefix, tl);
} catch (Exception ex) {
ex.printStackTrace();
Object[] args = new Object[] { uri, ex.getMessage() };
throw new JasperException(Constants.getString("jsp.error.badtaglib",
args));
}
}
if (directive.equals("include")) {
String file = (String) attrs.get("file");
String encoding = (String) attrs.get("encoding");
if (file == null)
throw new JasperException(Constants.getString("jsp.error.include.missing.file"));
// jsp.error.include.bad.file needs taking care of here??
try {
reader.pushFile(file, encoding);
} catch (FileNotFoundException fnfe) {
throw new JasperException(Constants.getString("jsp.error.include.bad.file"));
}
}
}
|
public void handleExpression(Mark start,
Mark stop) throws JasperException {
Generator gen
= new GeneratorWrapper(new ExpressionGenerator(reader.getChars(
start, stop)), start, stop);
addGenerator(gen);
}
|
public void handleForward(Mark start,
Mark stop,
Hashtable attrs,
Hashtable param) throws JasperException {
Generator gen
= new GeneratorWrapper(new ForwardGenerator(attrs, param),
start, stop);
addGenerator(gen);
}
|
public void handleGetProperty(Mark start,
Mark stop,
Hashtable attrs) throws JasperException {
Generator gen
= new GeneratorWrapper(new GetPropertyGenerator(start, stop, attrs,
beanInfo), start, stop);
addGenerator(gen);
}
|
public void handleInclude(Mark start,
Mark stop,
Hashtable attrs,
Hashtable param) throws JasperException {
Generator gen
= new GeneratorWrapper(new IncludeGenerator(attrs, param),
start, stop);
addGenerator(gen);
}
|
public void handlePlugin(Mark start,
Mark stop,
Hashtable attrs,
Hashtable param,
String fallback) throws JasperException {
Constants.message("jsp.message.handling_plugin",
new Object[] { attrs },
Constants.HIGH_VERBOSITY);
Generator gen = new GeneratorWrapper (new PluginGenerator (attrs,
param, fallback), start, stop);
addGenerator (gen);
}
|
public void handleScriptlet(Mark start,
Mark stop) throws JasperException {
Generator gen
= new GeneratorWrapper(new ScriptletGenerator(reader.getChars(
start, stop)), start, stop);
addGenerator(gen);
}
|
public void handleSetProperty(Mark start,
Mark stop,
Hashtable attrs) throws JasperException {
Generator gen
= new GeneratorWrapper(new SetPropertyGenerator(start, stop, attrs,
beanInfo), start, stop);
addGenerator(gen);
}
|
public void handleTagBegin(Mark start,
Hashtable attrs,
String prefix,
String shortTagName,
TagLibraryInfoImpl tli,
TagInfo ti) throws JasperException {
// FIXME: null's
Generator gen
= new GeneratorWrapper(new TagBeginGenerator(prefix, shortTagName, attrs,
tli, ti),
null, null);
addGenerator(gen);
}
|
public void handleTagEnd(Mark start,
Mark stop,
String prefix,
String shortTagName,
Hashtable attrs,
TagLibraryInfoImpl tli,
TagInfo ti) throws JasperException {
// FIXME: null's
Generator gen
= new GeneratorWrapper(new TagEndGenerator(prefix, shortTagName, attrs, tli, ti),
null, null);
addGenerator(gen);
}
|