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 StringBuilderprivate JspCompilationContextprivate Nodeprivate booleanprivate static final JspDocumentParser.EnableDTDValidationExceptionprivate ErrorDispatcherprivate booleanprivate booleanprivate booleanprivate booleanprivate static final Stringprivate static final Stringprivate static final Stringprivate Locatorprivate PageInfoprivate ParserControllerprivate Stringprivate Nodeprivate Markprivate intprivate booleanFields inherited from interface 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 voidaddInclude(Node parent, List files) private voidaddTaglibInfo(String prefix, String uri) voidcharacters(char[] buf, int offset, int len) private voidcheckPrefix(String uri, String qName) private voidcheckPrefixes(String uri, String qName, Attributes attrs) private voidcheckScriptingBody(Node.ScriptingElement scriptingElem) voidcomment(char[] buf, int offset, int len) voidendCDATA()voidendDTD()voidendElement(String uri, String localName, String qName) voidvoidendPrefixMapping(String prefix) voidvoidprivate static StringgetBodyType(Node.CustomTag custom) private static SAXParsergetSAXParser(boolean validating, JspDocumentParser jspDocParser) private booleanstatic Node.Nodesparse(ParserController pc, String path, JarFile jarFile, Node parent, boolean isTagFile, boolean directivesOnly, String pageEnc, String jspConfigPageEnc, boolean isEncodingSpecifiedInProlog) private NodeparseCustomAction(String qName, String localName, String uri, Attributes nonTaglibAttrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) private NodeparseStandardAction(String qName, String localName, Attributes nonTaglibAttrs, Attributes nonTaglibXmlnsAttrs, Attributes taglibAttrs, Mark start, Node parent) private voidprivate voidprocessIncludeDirective(String fname, Node parent) voidsetDocumentLocator(Locator locator) voidvoidvoidstartElement(String uri, String localName, String qName, Attributes attrs) voidstartEntity(String name) voidstartPrefixMapping(String prefix, String uri) Methods inherited from class DefaultHandler
endDocument, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startDocument, unparsedEntityDecl, warningMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:
startElementin interfaceContentHandler- Overrides:
startElementin classDefaultHandler- Throws:
SAXException
-
characters
public void characters(char[] buf, int offset, int len) - Specified by:
charactersin interfaceContentHandler- Overrides:
charactersin classDefaultHandler
-
processChars
- Throws:
SAXException
-
endElement
- Specified by:
endElementin interfaceContentHandler- Overrides:
endElementin classDefaultHandler- Throws:
SAXException
-
setDocumentLocator
- Specified by:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classDefaultHandler
-
comment
- Specified by:
commentin interfaceLexicalHandler- Throws:
SAXException
-
startCDATA
- Specified by:
startCDATAin interfaceLexicalHandler- Throws:
SAXException
-
endCDATA
- Specified by:
endCDATAin interfaceLexicalHandler- Throws:
SAXException
-
startEntity
- Specified by:
startEntityin interfaceLexicalHandler- Throws:
SAXException
-
endEntity
- Specified by:
endEntityin interfaceLexicalHandler- Throws:
SAXException
-
startDTD
- Specified by:
startDTDin interfaceLexicalHandler- Throws:
SAXException
-
endDTD
- Specified by:
endDTDin interfaceLexicalHandler- Throws:
SAXException
-
fatalError
- Specified by:
fatalErrorin interfaceErrorHandler- Overrides:
fatalErrorin classDefaultHandler- Throws:
SAXException
-
error
- Specified by:
errorin interfaceErrorHandler- Overrides:
errorin classDefaultHandler- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classDefaultHandler- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin 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
-