Class ParserController

  • All Implemented Interfaces:
    TagConstants

    public class ParserController
    extends java.lang.Object
    implements TagConstants
    Controller for the parsing of a JSP page.

    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.

    Author:
    Pierre Delisle, Jan Luehe
    • Method Detail

      • getCompiler

        public Compiler getCompiler()
      • parse

        public Node.Nodes parse​(java.lang.String inFileName)
                         throws JasperException,
                                java.io.IOException
        Parses a JSP page or tag file. This is invoked by the compiler.
        Parameters:
        inFileName - The path to the JSP page or tag file to be parsed.
        Returns:
        The parsed nodes
        Throws:
        JasperException - If an error occurs during parsing
        java.io.IOException - If an I/O error occurs such as the file not being found
      • parseDirectives

        public Node.Nodes parseDirectives​(java.lang.String inFileName)
                                   throws JasperException,
                                          java.io.IOException
        Parses the directives of a JSP page or tag file. This is invoked by the compiler.
        Parameters:
        inFileName - The path to the JSP page or tag file to be parsed.
        Returns:
        The parsed directive nodes
        Throws:
        JasperException - If an error occurs during parsing
        java.io.IOException - If an I/O error occurs such as the file not being found
      • parse

        public Node.Nodes parse​(java.lang.String inFileName,
                                Node parent,
                                Jar jar)
                         throws JasperException,
                                java.io.IOException
        Processes an include directive with the given path.
        Parameters:
        inFileName - The path to the resource to be included.
        parent - The parent node of the include directive.
        jar - The JAR file from which to read the included resource, or null of the included resource is to be read from the filesystem
        Returns:
        The parsed nodes
        Throws:
        JasperException - If an error occurs during parsing
        java.io.IOException - If an I/O error occurs such as the file not being found
      • parseTagFileDirectives

        public Node.Nodes parseTagFileDirectives​(java.lang.String inFileName,
                                                 Jar jar)
                                          throws JasperException,
                                                 java.io.IOException
        Extracts tag file directive information from the given tag file. This is invoked by the compiler
        Parameters:
        inFileName - The name of the tag file to be parsed.
        jar - The location of the tag file.
        Returns:
        The parsed tag file nodes
        Throws:
        JasperException - If an error occurs during parsing
        java.io.IOException - If an I/O error occurs such as the file not being found