class ParserController extends java.lang.Object implements TagConstants
The same ParserController instance is used for a JSP page and any JSP segments included by it (via an include directive), where each segment may be provided in standard or XML syntax. This class selects and invokes the appropriate parser for the JSP page and its included segments.
Modifier and Type | Field and Description |
---|---|
private java.util.Stack<java.lang.String> |
baseDirStack |
private static java.lang.String |
CHARSET |
private Compiler |
compiler |
private JspCompilationContext |
ctxt |
private boolean |
directiveOnly |
private ErrorDispatcher |
err |
private boolean |
hasBom |
private boolean |
isDefaultPageEncoding |
private boolean |
isEncodingSpecifiedInProlog |
private boolean |
isTagFile |
private boolean |
isXml |
private java.lang.String |
sourceEnc |
ATTRIBUTE_ACTION, ATTRIBUTE_DIRECTIVE_ACTION, BODY_ACTION, DECLARATION_ACTION, DIRECTIVE_ACTION, DOBODY_ACTION, ELEMENT_ACTION, EXPRESSION_ACTION, FALLBACK_ACTION, FORWARD_ACTION, GET_PROPERTY_ACTION, INCLUDE_ACTION, INCLUDE_DIRECTIVE_ACTION, INVOKE_ACTION, JSP_ATTRIBUTE_ACTION, JSP_ATTRIBUTE_DIRECTIVE_ACTION, JSP_BODY_ACTION, JSP_DECLARATION_ACTION, JSP_DOBODY_ACTION, JSP_ELEMENT_ACTION, JSP_EXPRESSION_ACTION, JSP_FALLBACK_ACTION, JSP_FORWARD_ACTION, JSP_GET_PROPERTY_ACTION, JSP_INCLUDE_ACTION, JSP_INCLUDE_DIRECTIVE_ACTION, JSP_INVOKE_ACTION, JSP_OUTPUT_ACTION, JSP_PAGE_DIRECTIVE_ACTION, JSP_PARAM_ACTION, JSP_PARAMS_ACTION, JSP_PLUGIN_ACTION, JSP_ROOT_ACTION, JSP_SCRIPTLET_ACTION, JSP_SET_PROPERTY_ACTION, JSP_TAG_DIRECTIVE_ACTION, JSP_TAGLIB_DIRECTIVE_ACTION, JSP_TEXT_ACTION, JSP_TEXT_ACTION_END, JSP_URI, JSP_USE_BEAN_ACTION, JSP_VARIABLE_DIRECTIVE_ACTION, OUTPUT_ACTION, PAGE_DIRECTIVE_ACTION, PARAM_ACTION, PARAMS_ACTION, PLUGIN_ACTION, ROOT_ACTION, SCRIPTLET_ACTION, SET_PROPERTY_ACTION, TAG_DIRECTIVE_ACTION, TAGLIB_DIRECTIVE_ACTION, TEXT_ACTION, URN_JSPTAGDIR, URN_JSPTLD, USE_BEAN_ACTION, VARIABLE_DIRECTIVE_ACTION
Constructor and Description |
---|
ParserController(JspCompilationContext ctxt,
Compiler compiler) |
Modifier and Type | Method and Description |
---|---|
private void |
comparePageEncodings(java.lang.String jspConfigPageEnc) |
private void |
determineSyntaxAndEncoding(java.lang.String absFileName,
java.util.jar.JarFile jarFile,
java.lang.String jspConfigPageEnc)
Determines the syntax (standard or XML) and page encoding properties
for the given file, and stores them in the 'isXml' and 'sourceEnc'
instance variables, respectively.
|
private Node.Nodes |
doParse(java.lang.String inFileName,
Node parent,
java.net.URL jarFileUrl)
Parses the JSP page or tag file with the given path name.
|
Compiler |
getCompiler() |
private java.util.jar.JarFile |
getJarFile(java.net.URL jarFileUrl) |
JspCompilationContext |
getJspCompilationContext() |
private java.lang.String |
getJspConfigPageEncoding(java.lang.String absFileName) |
private java.lang.String |
getPageEncodingForJspSyntax(JspReader jspReader,
Mark startMark) |
private java.lang.String |
getPageEncodingFromDirective(org.xml.sax.Attributes attrs,
java.lang.String attrName) |
private boolean |
hasJspRoot(JspReader reader) |
Node.Nodes |
parse(java.lang.String inFileName)
Parses a JSP page or tag file.
|
Node.Nodes |
parse(java.lang.String inFileName,
Node parent,
java.net.URL jarFileUrl)
Processes an include directive with the given path.
|
Node.Nodes |
parseTagFileDirectives(java.lang.String inFileName)
Extracts tag file directive information from the tag file with the
given name.
|
private java.lang.String |
resolveFileName(java.lang.String inFileName) |
private static final java.lang.String CHARSET
private JspCompilationContext ctxt
private Compiler compiler
private ErrorDispatcher err
private boolean isXml
private java.util.Stack<java.lang.String> baseDirStack
private boolean isEncodingSpecifiedInProlog
private boolean hasBom
private java.lang.String sourceEnc
private boolean isDefaultPageEncoding
private boolean isTagFile
private boolean directiveOnly
public ParserController(JspCompilationContext ctxt, Compiler compiler)
public JspCompilationContext getJspCompilationContext()
public Compiler getCompiler()
public Node.Nodes parse(java.lang.String inFileName) throws java.io.FileNotFoundException, JasperException, java.io.IOException
inFileName
- The path to the JSP page or tag file to be parsed.java.io.FileNotFoundException
JasperException
java.io.IOException
public Node.Nodes parse(java.lang.String inFileName, Node parent, java.net.URL jarFileUrl) throws java.io.FileNotFoundException, JasperException, java.io.IOException
inFileName
- The path to the resource to be included.parent
- The parent node of the include directive.jarFile
- The JAR file from which to read the included resource,
or null of the included resource is to be read from the filesystemjava.io.FileNotFoundException
JasperException
java.io.IOException
public Node.Nodes parseTagFileDirectives(java.lang.String inFileName) throws java.io.FileNotFoundException, JasperException, java.io.IOException
inFileName
- The name of the tag file to be parsed.java.io.FileNotFoundException
JasperException
java.io.IOException
private Node.Nodes doParse(java.lang.String inFileName, Node parent, java.net.URL jarFileUrl) throws java.io.FileNotFoundException, JasperException, java.io.IOException
inFileName
- The name of the JSP page or tag file to be parsed.parent
- The parent node (non-null when processing an include
directive)isTagFile
- true if file to be parsed is tag file, and false if it
is a regular JSP pagedirectivesOnly
- true if the file to be parsed is a tag file and
we are only interested in the directives needed for constructing a
TagFileInfo.jarFile
- The JAR file from which to read the JSP page or tag file,
or null if the JSP page or tag file is to be read from the filesystemjava.io.FileNotFoundException
JasperException
java.io.IOException
private void comparePageEncodings(java.lang.String jspConfigPageEnc) throws JasperException
JasperException
private java.lang.String getJspConfigPageEncoding(java.lang.String absFileName) throws JasperException
JasperException
private void determineSyntaxAndEncoding(java.lang.String absFileName, java.util.jar.JarFile jarFile, java.lang.String jspConfigPageEnc) throws JasperException, java.io.IOException
JasperException
java.io.IOException
private java.lang.String getPageEncodingForJspSyntax(JspReader jspReader, Mark startMark) throws JasperException
JasperException
private java.lang.String getPageEncodingFromDirective(org.xml.sax.Attributes attrs, java.lang.String attrName)
private java.lang.String resolveFileName(java.lang.String inFileName)
private boolean hasJspRoot(JspReader reader) throws JasperException
JasperException
private java.util.jar.JarFile getJarFile(java.net.URL jarFileUrl) throws java.io.IOException
java.io.IOException