org.richfaces.cdk.templatecompiler.el.types
Class TypesFactoryImpl

java.lang.Object
  extended by org.richfaces.cdk.templatecompiler.el.types.TypesFactoryImpl
All Implemented Interfaces:
TypesFactory

public final class TypesFactoryImpl
extends java.lang.Object
implements TypesFactory

Author:
Nick Belaevski

Field Summary
 
Fields inherited from interface org.richfaces.cdk.templatecompiler.el.types.TypesFactory
BOOLEAN_TYPE, DOUBLE_TYPE, INT_TYPE, INTEGER_TYPE, OBJECT_TYPE, STRING_TYPE, VOID_TYPE
 
Constructor Summary
TypesFactoryImpl(org.richfaces.cdk.Logger log, CdkClassLoader classLoader)
           
 
Method Summary
 ELType getMatchingVisibleMethodReturnType(ELType elType, java.lang.String methodName, ELType... parameterTypes)
           Find an accessible method that matches the given name and has compatible parameters.
 ELPropertyDescriptor getPropertyDescriptor(ELType elType, java.lang.String propertyName)
          This method return PropertyDescriptor by specified propertyName and clazz.
 ELType getType(java.lang.String typeString)
          

 ELType getType(java.lang.reflect.Type reflectionType)
          

 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypesFactoryImpl

@Inject
public TypesFactoryImpl(org.richfaces.cdk.Logger log,
                               CdkClassLoader classLoader)
Method Detail

getType

public ELType getType(java.lang.String typeString)
Description copied from interface: TypesFactory

Specified by:
getType in interface TypesFactory
Returns:

getType

public ELType getType(java.lang.reflect.Type reflectionType)
Description copied from interface: TypesFactory

Specified by:
getType in interface TypesFactory
Returns:

getPropertyDescriptor

public ELPropertyDescriptor getPropertyDescriptor(ELType elType,
                                                  java.lang.String propertyName)
                                           throws ParsingException
This method return PropertyDescriptor by specified propertyName and clazz.

Specified by:
getPropertyDescriptor in interface TypesFactory
Parameters:
elType - - class to search
propertyName - - propertyName to search
Returns:
property descriptor if found.
Throws:
ParsingException - if error occured.

getMatchingVisibleMethodReturnType

public ELType getMatchingVisibleMethodReturnType(ELType elType,
                                                 java.lang.String methodName,
                                                 ELType... parameterTypes)
                                          throws ParsingException

Find an accessible method that matches the given name and has compatible parameters. Compatible parameters mean that every method parameter is assignable from the given parameters. In other words, it finds a method with the given name that will take the parameters given.

This method is slightly undeterminstic since it loops through methods names and return the first matching method.

This method is used by #invokeMethod(Object object,String methodName,Object [] args,Class[] parameterTypes).

This method can match primitive parameter by passing in wrapper classes. For example, a Boolean will match a primitive boolean parameter.

Specified by:
getMatchingVisibleMethodReturnType in interface TypesFactory
Parameters:
elType - find method in this class
methodName - find method with this name
parameterTypes - find method with compatible parameters
Returns:
The accessible method
Throws:
ParsingException - if error occured.


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.