
org.apache.jasper.compiler.ParserController Maven / Gradle / Ivy
/*
* Copyright 1999,2004 The Apache Software Foundation.
*
* Licensed 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.compiler;
import java.io.*;
import java.util.*;
import org.xml.sax.Attributes;
import org.apache.jasper.*;
/**
* Controller for the parsing of a JSP page.
*
* A translation unit (JSP source file and any files included via the
* include directive) may involve the processing of JSP pages
* written with different syntaxes (currently the original JSP syntax,
* as well as the XML syntax (as of JSP 1.2)). This class encapsulates
* the behavior related to the selection and invocation of
* the proper parser.
*
* @author Pierre Delisle
*/
public class ParserController {
/*
* The compilation context
*/
private JspCompilationContext ctxt;
/*
* The Compiler
*/
private Compiler compiler;
/*
* A stack to keep track of the 'current base directory'
* for include directives that refer to relative paths.
*/
private Stack baseDirStack = new Stack();
/*
* Document information which tells us what
* kind of document we are dealing with.
*/
private boolean isXml;
/*
* Static information used in the process of figuring out
* the kind of document we're dealing with.
*/
private static final String JSP_ROOT_TAG = "