org.richfaces.cdk.templatecompiler.el
Class ELVisitor
java.lang.Object
org.richfaces.cdk.templatecompiler.el.ELVisitor
- All Implemented Interfaces:
- JavaStatement, RequireImports, TemplateStatement, TypedTemplateStatement
public final class ELVisitor
- extends Object
- implements TypedTemplateStatement
Entry point for parsing EL expressions. @see parse() method.
- Author:
- amarkhel
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ELVisitor
public ELVisitor(org.richfaces.cdk.Logger log,
TypesFactory typesFactory)
isMixedExpression
public boolean isMixedExpression()
isLiteral
public boolean isLiteral()
- Specified by:
isLiteral in interface TypedTemplateStatement
- Returns:
- the literal
setLiteral
public void setLiteral(boolean literal)
- Parameters:
literal - the literal to set
getType
public ELType getType()
- Specified by:
getType in interface TypedTemplateStatement
setExpressionType
public void setExpressionType(ELType variableType)
getVariable
public ELType getVariable(String name)
throws ParsingException
- Throws:
ParsingException
parse
public void parse(String expression,
Variables contextVariables,
ELType expectedType)
throws ParsingException
- Parse specified EL expression and return Java code, that represent this expression
- Parameters:
expression - - expression to resolvecontextMap - - Map> - context for search classes.
- Throws:
ParsingException - - if error occurred during parsing.
coerceToType
public String coerceToType(String valueString,
ELType expectedType)
getCode
public String getCode()
- Specified by:
getCode in interface JavaStatement
getRequiredImports
public Iterable<JavaImport> getRequiredImports()
- Specified by:
getRequiredImports in interface RequireImports
getRequiredFields
public Iterable<JavaField> getRequiredFields()
- Specified by:
getRequiredFields in interface TemplateStatement
getRequiredMethods
public Iterable<HelperMethod> getRequiredMethods()
- Specified by:
getRequiredMethods in interface TemplateStatement
getMatchingVisibleMethodReturnType
public ELType getMatchingVisibleMethodReturnType(String methodName,
ELType[] parameterTypes)
throws ParsingException
- Throws:
ParsingException
getPropertyDescriptor
public ELPropertyDescriptor getPropertyDescriptor(String propertyName)
throws ParsingException
- Throws:
ParsingException
addHelperMethods
public void addHelperMethods(HelperMethod helper)
determineNodeType
public ITreeNode determineNodeType(org.jboss.el.parser.Node child)
throws ParsingException
- This method determine type of parsed node and create wrapper for them, that extends AbstractTreeNode. If node type is not
recognized - throws ParsingException.
- Parameters:
child - - parsed node
- Returns:
- wrapper for parsed node(if node type is recognized), that implement ITreeNode interface.
- Throws:
ParsingException - - if node type is not recognized.
setParent
public void setParent(StatementsContainer parent)
- Specified by:
setParent in interface TemplateStatement
Copyright © 2012 JBoss by Red Hat. All Rights Reserved.