Package org.apache.jasper.compiler
Class Validator.ValidateVisitor
- java.lang.Object
-
- org.apache.jasper.compiler.Node.Visitor
-
- org.apache.jasper.compiler.Validator.ValidateVisitor
-
- Enclosing class:
- Validator
static class Validator.ValidateVisitor extends Node.Visitor
A visitor for validating nodes other than page directives
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classValidator.ValidateVisitor.NamedAttributeVisitor
-
Field Summary
Fields Modifier and Type Field Description private static JspUtil.ValidAttribute[]attributeAttrsprivate JspCompilationContextctxtprivate static JspUtil.ValidAttribute[]doBodyAttrsprivate ErrorDispatchererrprivate static JspUtil.ValidAttribute[]forwardActionAttrsprivate static JspUtil.ValidAttribute[]getPropertyAttrsprivate static JspUtil.ValidAttribute[]includeActionAttrsprivate static JspUtil.ValidAttribute[]includeDirectiveAttrsprivate static JspUtil.ValidAttribute[]invokeAttrsprivate static JspUtil.ValidAttribute[]jspOutputAttrsprivate static JspUtil.ValidAttribute[]jspRootAttrsprivate java.lang.ClassLoaderloaderprivate PageInfopageInfoprivate static JspUtil.ValidAttribute[]paramActionAttrsprivate static JspUtil.ValidAttribute[]plugInAttrsprivate static JspUtil.ValidAttribute[]setPropertyAttrsprivate static JspUtil.ValidAttribute[]taglibDirectiveAttrsprivate static JspUtil.ValidAttribute[]useBeanAttrs
-
Constructor Summary
Constructors Constructor Description ValidateVisitor(Compiler compiler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckNamedAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, int start, java.util.Hashtable<java.lang.String,java.lang.Object> tagDataAttrs)private voidcheckSetter(Node.CustomTag n, javax.servlet.jsp.tagext.TagAttributeInfo tldattr)private voidcheckXmlAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, java.util.Hashtable<java.lang.String,java.lang.Object> tagDataAttrs)private java.lang.StringescapePound(java.lang.String value)private java.lang.StringfindUri(java.lang.String prefix, Node n)private javax.el.FunctionMappergetFunctionMapper(ELNode.Nodes el)private Node.JspAttributegetJspAttribute(java.lang.String qName, java.lang.String uri, java.lang.String localName, java.lang.String value, Node n, boolean dynamic, javax.servlet.jsp.tagext.TagAttributeInfo tagAttr)Preprocess attributes that can be expressions.private java.lang.StringgetLiteral(Node n, java.lang.String value)private java.lang.StringgetMethod(java.lang.String signature)Get the method name from the signature.private java.lang.String[]getParameters(java.lang.String signature)Get the parameters types from the function signature.private java.lang.StringgetReturnType(java.lang.String signature)Get the return type from the signature.private voidprocessSignature(ELNode.Function func)private voidthrowErrorIfExpression(Node n, java.lang.String attrName, java.lang.String actionName)private voidvalidateFunctions(ELNode.Nodes el, Node n)Validate functions in EL expressionsvoidvisit(Node.CustomTag n)voidvisit(Node.Declaration n)voidvisit(Node.DoBodyAction n)voidvisit(Node.ELExpression n)voidvisit(Node.Expression n)voidvisit(Node.ForwardAction n)voidvisit(Node.GetProperty n)voidvisit(Node.IncludeAction n)voidvisit(Node.IncludeDirective n)voidvisit(Node.InvokeAction n)voidvisit(Node.JspBody n)voidvisit(Node.JspElement n)voidvisit(Node.JspOutput n)voidvisit(Node.JspRoot n)voidvisit(Node.NamedAttribute n)voidvisit(Node.ParamAction n)voidvisit(Node.ParamsAction n)voidvisit(Node.PlugIn n)voidvisit(Node.Scriptlet n)voidvisit(Node.SetProperty n)voidvisit(Node.TaglibDirective n)voidvisit(Node.UninterpretedTag n)voidvisit(Node.UseBean n)
-
-
-
Field Detail
-
pageInfo
private PageInfo pageInfo
-
err
private ErrorDispatcher err
-
loader
private java.lang.ClassLoader loader
-
ctxt
private JspCompilationContext ctxt
-
jspRootAttrs
private static final JspUtil.ValidAttribute[] jspRootAttrs
-
includeDirectiveAttrs
private static final JspUtil.ValidAttribute[] includeDirectiveAttrs
-
taglibDirectiveAttrs
private static final JspUtil.ValidAttribute[] taglibDirectiveAttrs
-
includeActionAttrs
private static final JspUtil.ValidAttribute[] includeActionAttrs
-
paramActionAttrs
private static final JspUtil.ValidAttribute[] paramActionAttrs
-
forwardActionAttrs
private static final JspUtil.ValidAttribute[] forwardActionAttrs
-
getPropertyAttrs
private static final JspUtil.ValidAttribute[] getPropertyAttrs
-
setPropertyAttrs
private static final JspUtil.ValidAttribute[] setPropertyAttrs
-
useBeanAttrs
private static final JspUtil.ValidAttribute[] useBeanAttrs
-
plugInAttrs
private static final JspUtil.ValidAttribute[] plugInAttrs
-
attributeAttrs
private static final JspUtil.ValidAttribute[] attributeAttrs
-
invokeAttrs
private static final JspUtil.ValidAttribute[] invokeAttrs
-
doBodyAttrs
private static final JspUtil.ValidAttribute[] doBodyAttrs
-
jspOutputAttrs
private static final JspUtil.ValidAttribute[] jspOutputAttrs
-
-
Constructor Detail
-
ValidateVisitor
ValidateVisitor(Compiler compiler)
-
-
Method Detail
-
visit
public void visit(Node.JspRoot n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.IncludeDirective n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.TaglibDirective n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.ParamAction n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.ParamsAction n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.IncludeAction n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.ForwardAction n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.GetProperty n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.SetProperty n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.UseBean n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.PlugIn n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.NamedAttribute n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.JspBody n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.Declaration n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.Expression n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.Scriptlet n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.ELExpression n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.UninterpretedTag n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.CustomTag n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.JspElement n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.JspOutput n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.InvokeAction n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
visit
public void visit(Node.DoBodyAction n) throws JasperException
- Overrides:
visitin classNode.Visitor- Throws:
JasperException
-
checkSetter
private void checkSetter(Node.CustomTag n, javax.servlet.jsp.tagext.TagAttributeInfo tldattr) throws JasperException
- Throws:
JasperException
-
checkXmlAttributes
private void checkXmlAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, java.util.Hashtable<java.lang.String,java.lang.Object> tagDataAttrs) throws JasperException
- Throws:
JasperException
-
checkNamedAttributes
private void checkNamedAttributes(Node.CustomTag n, Node.JspAttribute[] jspAttrs, int start, java.util.Hashtable<java.lang.String,java.lang.Object> tagDataAttrs) throws JasperException
- Throws:
JasperException
-
getJspAttribute
private Node.JspAttribute getJspAttribute(java.lang.String qName, java.lang.String uri, java.lang.String localName, java.lang.String value, Node n, boolean dynamic, javax.servlet.jsp.tagext.TagAttributeInfo tagAttr) throws JasperException
Preprocess attributes that can be expressions. Expression delimiters are stripped.If value is null, checks if there are any NamedAttribute subelements in the tree node, and if so, constructs a JspAttribute out of a child NamedAttribute node.
- Throws:
JasperException
-
getLiteral
private java.lang.String getLiteral(Node n, java.lang.String value)
-
throwErrorIfExpression
private void throwErrorIfExpression(Node n, java.lang.String attrName, java.lang.String actionName) throws JasperException
- Throws:
JasperException
-
escapePound
private java.lang.String escapePound(java.lang.String value)
-
findUri
private java.lang.String findUri(java.lang.String prefix, Node n)
-
validateFunctions
private void validateFunctions(ELNode.Nodes el, Node n) throws JasperException
Validate functions in EL expressions- Throws:
JasperException
-
processSignature
private void processSignature(ELNode.Function func) throws JasperException
- Throws:
JasperException
-
getReturnType
private java.lang.String getReturnType(java.lang.String signature) throws JasperExceptionGet the return type from the signature.- Throws:
JasperException
-
getMethod
private java.lang.String getMethod(java.lang.String signature) throws JasperExceptionGet the method name from the signature.- Throws:
JasperException
-
getParameters
private java.lang.String[] getParameters(java.lang.String signature) throws JasperExceptionGet the parameters types from the function signature.- Returns:
- An array of parameter class names
- Throws:
JasperException
-
getFunctionMapper
private javax.el.FunctionMapper getFunctionMapper(ELNode.Nodes el) throws JasperException
- Throws:
JasperException
-
-