Package org.apache.jasper.compiler
Class JspDocumentParser
java.lang.Object
org.xml.sax.helpers.DefaultHandler
org.apache.jasper.compiler.JspDocumentParser
- All Implemented Interfaces:
TagConstants
,ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,LexicalHandler
Class implementing a parser for a JSP document, that is, a JSP page in XML
syntax.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringBuilder
private JspCompilationContext
private Node
private boolean
private static final JspDocumentParser.EnableDTDValidationException
private ErrorDispatcher
private boolean
private boolean
private boolean
private boolean
private static final String
private static final String
private static final String
private Locator
private PageInfo
private ParserController
private String
private Node
private Mark
private int
private boolean
Fields inherited from interface org.apache.jasper.compiler.TagConstants
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_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 Summary
ConstructorsConstructorDescriptionJspDocumentParser
(ParserController pc, String path, boolean isTagFile, boolean directivesOnly) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addInclude
(Node parent, List files) private void
addTaglibInfo
(String prefix, String uri) void
characters
(char[] buf, int offset, int len) private void
checkPrefix
(String uri, String qName) private void
checkPrefixes
(String uri, String qName, Attributes attrs) private void
checkScriptingBody
(Node.ScriptingElement scriptingElem) void
comment
(char[] buf, int offset, int len) void
endCDATA()
void
endDTD()
void
endElement
(String uri, String localName, String qName) void
void
endPrefixMapping
(String prefix) void
void
private static String
getBodyType
(Node.CustomTag custom) private static SAXParser
getSAXParser
(boolean validating, JspDocumentParser jspDocParser) private boolean
static Node.Nodes
parse
(ParserController pc, String path, JarFile jarFile, Node parent, boolean isTagFile, boolean directivesOnly, String pageEnc, String jspConfigPageEnc, boolean isEncodingSpecifiedInProlog) private Node
parseCustomAction
(String qName, String localName, String uri, Attributes nonTaglibAttrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) private Node
parseStandardAction
(String qName, String localName, Attributes nonTaglibAttrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) private void
private void
processIncludeDirective
(String fname, Node parent) void
setDocumentLocator
(Locator locator) void
void
void
startElement
(String uri, String localName, String qName, Attributes attrs) void
startEntity
(String name) void
startPrefixMapping
(String prefix, String uri) Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, unparsedEntityDecl, warning
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Field Details
-
JSP_VERSION
- See Also:
-
LEXICAL_HANDLER_PROPERTY
- See Also:
-
JSP_URI
- See Also:
-
ENABLE_DTD_VALIDATION_EXCEPTION
-
parserController
-
ctxt
-
pageInfo
-
path
-
charBuffer
-
current
-
scriptlessBodyNode
-
locator
-
startMark
-
inDTD
private boolean inDTD -
isValidating
private boolean isValidating -
err
-
isTagFile
private boolean isTagFile -
directivesOnly
private boolean directivesOnly -
isTop
private boolean isTop -
tagDependentNesting
private int tagDependentNesting -
tagDependentPending
private boolean tagDependentPending
-
-
Constructor Details
-
JspDocumentParser
public JspDocumentParser(ParserController pc, String path, boolean isTagFile, boolean directivesOnly)
-
-
Method Details
-
parse
public static Node.Nodes parse(ParserController pc, String path, JarFile jarFile, Node parent, boolean isTagFile, boolean directivesOnly, String pageEnc, String jspConfigPageEnc, boolean isEncodingSpecifiedInProlog) throws JasperException - Throws:
JasperException
-
addInclude
- Throws:
SAXException
-
startElement
public void startElement(String uri, String localName, String qName, Attributes attrs) throws SAXException - Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classDefaultHandler
- Throws:
SAXException
-
characters
public void characters(char[] buf, int offset, int len) - Specified by:
characters
in interfaceContentHandler
- Overrides:
characters
in classDefaultHandler
-
processChars
- Throws:
SAXException
-
endElement
- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classDefaultHandler
- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classDefaultHandler
-
comment
- Specified by:
comment
in interfaceLexicalHandler
- Throws:
SAXException
-
startCDATA
- Specified by:
startCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATA
in interfaceLexicalHandler
- Throws:
SAXException
-
startEntity
- Specified by:
startEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
endEntity
- Specified by:
endEntity
in interfaceLexicalHandler
- Throws:
SAXException
-
startDTD
- Specified by:
startDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
endDTD
- Specified by:
endDTD
in interfaceLexicalHandler
- Throws:
SAXException
-
fatalError
- Specified by:
fatalError
in interfaceErrorHandler
- Overrides:
fatalError
in classDefaultHandler
- Throws:
SAXException
-
error
- Specified by:
error
in interfaceErrorHandler
- Overrides:
error
in classDefaultHandler
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classDefaultHandler
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classDefaultHandler
- Throws:
SAXException
-
parseStandardAction
private Node parseStandardAction(String qName, String localName, Attributes nonTaglibAttrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) throws SAXException - Throws:
SAXException
-
parseCustomAction
private Node parseCustomAction(String qName, String localName, String uri, Attributes nonTaglibAttrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) throws SAXException - Throws:
SAXException
-
addTaglibInfo
- Throws:
JasperException
-
checkScriptingBody
- Throws:
SAXException
-
processIncludeDirective
- Throws:
SAXException
-
checkPrefixes
-
checkPrefix
-
getSAXParser
private static SAXParser getSAXParser(boolean validating, JspDocumentParser jspDocParser) throws Exception - Throws:
Exception
-
getBodyType
-
isTagDependent
-