RichFaces CDK Generator 4.2.0.CR1

org.richfaces.cdk.templatecompiler.el
Class ELVisitor

java.lang.Object
  extended by 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

Field Summary
 
Fields inherited from interface org.richfaces.cdk.templatecompiler.statements.TemplateStatement
FIELDS_TRANSFORM, METHODS_TRANSFORM
 
Fields inherited from interface org.richfaces.cdk.templatecompiler.builder.model.RequireImports
IMPORTS_TRANSFORM
 
Constructor Summary
ELVisitor(org.richfaces.cdk.Logger log, TypesFactory typesFactory)
           
 
Method Summary
 void addHelperMethods(HelperMethod helper)
           
 String coerceToType(String valueString, ELType expectedType)
           
 ITreeNode determineNodeType(org.jboss.el.parser.Node child)
          This method determine type of parsed node and create wrapper for them, that extends AbstractTreeNode.
 String getCode()
           
 ELType getMatchingVisibleMethodReturnType(String methodName, ELType[] parameterTypes)
           
 ELPropertyDescriptor getPropertyDescriptor(String propertyName)
           
 Iterable<JavaField> getRequiredFields()
           
 Iterable<JavaImport> getRequiredImports()
           
 Iterable<HelperMethod> getRequiredMethods()
           
 ELType getType()
           
 ELType getVariable(String name)
           
 boolean isLiteral()
          

 boolean isMixedExpression()
           
 void parse(String expression, Variables contextVariables, ELType expectedType)
          Parse specified EL expression and return Java code, that represent this expression
 void setExpressionType(ELType variableType)
           
 void setLiteral(boolean literal)
          

 void setParent(StatementsContainer parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ELVisitor

public ELVisitor(org.richfaces.cdk.Logger log,
                 TypesFactory typesFactory)
Method Detail

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 resolve
contextMap - - 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

RichFaces CDK Generator 4.2.0.CR1

Copyright © 2012 JBoss by Red Hat. All Rights Reserved.