beanface.el.functor
Class FunctorIdentification

java.lang.Object
  extended by beanface.el.functor.FunctorIdentification

public class FunctorIdentification
extends java.lang.Object

Configuration for the FunctorELResolver plugin. Controls how the functor references are identified. Default values can be overriden by context initialization parameters.


Constructor Summary
FunctorIdentification()
          Constructor with all configuration items taking their default values.
FunctorIdentification(javax.faces.context.ExternalContext context)
          Constructor configured from the init parameters in a Faces ExternalContext (which usually wraps either a ServletContext or a PortletContext).
FunctorIdentification(javax.servlet.ServletContext context)
          Constructor configured from the init parameters in a ServletContext.
FunctorIdentification(java.lang.String functorIndicator, java.lang.String deferredIndicator, java.lang.String implicitClassObjectName, java.lang.String constructorName)
          Contructor providing explicit values for each config item.
 
Method Summary
 java.lang.String functionIdent(java.lang.reflect.Constructor constructor, boolean isDeferred)
          Reconstruct a functor reference for a constructor.
 java.lang.String functionIdent(java.lang.reflect.Method method, boolean isDeferred)
          Reconstruct a functor reference for a method.
 int getExplicitParamCount(java.lang.String methodID)
          Determine the number of parameters explicitly specified in methodID.
 boolean isConstructorIdent(java.lang.String methodID)
          Determine if the methodID is a reference to a contructor or not.
 boolean isDeferredMethodIdent(java.lang.String methodID)
          Determine if the methodID is a reference to a deferred method or not.
 boolean isFunctorIdentifier(java.lang.String name)
          Determine if the name is a reference to a functor or not.
 boolean isImplicitClassObjectName(java.lang.Object name)
          Determine if the name is equal to the configured "class" object name (the start of a FQJN).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctorIdentification

public FunctorIdentification(java.lang.String functorIndicator,
                             java.lang.String deferredIndicator,
                             java.lang.String implicitClassObjectName,
                             java.lang.String constructorName)
Contructor providing explicit values for each config item. Any parameter that is null or an empty string reverts to its default value.

Parameters:
functorIndicator - defaults to "$"
deferredIndicator - defaults to "_"
implicitClassObjectName - defaults to "class"
constructorName - defaults to "new"

FunctorIdentification

public FunctorIdentification()
Constructor with all configuration items taking their default values.


FunctorIdentification

public FunctorIdentification(javax.faces.context.ExternalContext context)
Constructor configured from the init parameters in a Faces ExternalContext (which usually wraps either a ServletContext or a PortletContext).


FunctorIdentification

public FunctorIdentification(javax.servlet.ServletContext context)
Constructor configured from the init parameters in a ServletContext.

Method Detail

isFunctorIdentifier

public boolean isFunctorIdentifier(java.lang.String name)
Determine if the name is a reference to a functor or not.

Parameters:
name - The reference identifier.

isImplicitClassObjectName

public boolean isImplicitClassObjectName(java.lang.Object name)
Determine if the name is equal to the configured "class" object name (the start of a FQJN).

Parameters:
name - The reference identifier.

isDeferredMethodIdent

public boolean isDeferredMethodIdent(java.lang.String methodID)
Determine if the methodID is a reference to a deferred method or not. It is assumed that isFunctorIdentifier(java.lang.String) on the methodID already returned true.

Parameters:
methodID - The reference methodID.

getExplicitParamCount

public int getExplicitParamCount(java.lang.String methodID)
Determine the number of parameters explicitly specified in methodID. It is assumed that isFunctorIdentifier(java.lang.String) on the methodID already returned true.

Parameters:
methodID - The reference methodID.
Returns:
the number of parameters specified in the methodID, or UnspecifiedParamCount if none.

isConstructorIdent

public boolean isConstructorIdent(java.lang.String methodID)
Determine if the methodID is a reference to a contructor or not.

Parameters:
methodID - The reference methodID.

functionIdent

public java.lang.String functionIdent(java.lang.reflect.Method method,
                                      boolean isDeferred)
Reconstruct a functor reference for a method.

Parameters:
method - the method object for which the functor reference is being constructed.
isDeferred - determines if the reference should include the deferred indicator.
Returns:
the functor reference name.

functionIdent

public java.lang.String functionIdent(java.lang.reflect.Constructor constructor,
                                      boolean isDeferred)
Reconstruct a functor reference for a constructor.

Parameters:
constructor - the constructor object for which the functor reference is being constructed.
isDeferred - determines if the reference should include the deferred indicator.
Returns:
the functor reference name.