|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object beanface.el.functor.Functor<T>
T
- The base class which the target method is a member of.public class Functor<T>
A Functor is an abstraction of a function that maps a single parameter to a
result. The result is either an arbitrary object, or a second functor which
can take a further parameter. Once the appropriate number of parameters are
accumulated for the method identified by the FunctorStub
, that
method is invoked to obtain the final result.
Constructor Summary | |
---|---|
Functor(javax.el.ELContext context,
FunctorStub<T> functor)
Construct a functor from an EL context and FunctorStub with no
initial parameters. |
|
Functor(javax.el.ELContext context,
FunctorStub<T> functor,
Functor<T> preceding,
java.lang.Object param)
Construct a functor by applying new parameter to a previous functor. |
Method Summary | |
---|---|
java.lang.String |
action()
For JavaServer Faces action methods. |
java.lang.Object |
applyParam(javax.el.ELContext context,
java.lang.Object property)
If no more parameters can be applied, or if sufficient parameters have been applied and the new parameter is "result", then invoke the functor's method and return the result. |
java.lang.Object |
applyParams(javax.el.ELContext context,
java.lang.Object... params)
Apply as many of the given parameters as possible. |
java.lang.Class<?> |
getAllowedParamType()
Determine what type the next parameter may validly be. |
FunctorStub<T> |
getFunctor()
The functor identification (reference to a method or constructor) that this functor will invoke. |
java.lang.Object |
getParam()
The last applied parameter. |
int |
getParamCount()
How many parameters have been supplied so far. |
int |
getParamCountRequired()
What is the minimum number of parameters the must be supplied to allow the method to be invoked. |
java.lang.Object[] |
getParams()
An array of the parameters that have been supplied so far. |
Functor<T> |
getPreceding()
The functor state before the current parameter was applied. |
java.lang.Object |
getResult(javax.el.ELContext context)
If there are sufficient parameters, then invoke the functor's method and return the result. |
java.lang.Object |
getResultOrSelf(javax.el.ELContext context)
If this functor is not deferred, and no more parameters can be applied, then invoke the functor's method and return the result. |
boolean |
hasFixedArgs()
Is there a definite number of parameters to be applied? |
boolean |
hasSufficientParams()
Are there sufficient parameters already supplied to allow the method to be invoked ( getParamCount() is greater-or-equal-to
getParamCountRequired() )? |
boolean |
hasVarArgs()
Does the method or constructor referred to by this functor have var-arg parameters? |
boolean |
isDeferred()
If the functor is deferred, the method will not be automatically invoked once the needed parameters have been provided. |
void |
processValueChange(javax.faces.event.ValueChangeEvent event)
For JavaServer Faces value-change methods. |
java.lang.String |
toString()
Create a String representation of this functor and the applied parameters for debugging purposes. |
void |
validate(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent toValidate,
java.lang.Object value)
For JavaServer Faces validation methods. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Functor(javax.el.ELContext context, FunctorStub<T> functor)
FunctorStub
with no
initial parameters.
context
- the EL contextfunctor
- the FunctorStub
identifying the method or constructor
that this functor applies to.public Functor(javax.el.ELContext context, FunctorStub<T> functor, Functor<T> preceding, java.lang.Object param)
context
- the EL contextfunctor
- the FunctorStub
identifying the method or constructor
that this functor applies to.preceding
- the previous functor (with incomplete parameters) to which the
parameter will be applied.param
- the new parameter to apply.Method Detail |
---|
public FunctorStub<T> getFunctor()
public Functor<T> getPreceding()
public java.lang.Object getParam()
public int getParamCount()
public java.lang.Object[] getParams()
public int getParamCountRequired()
public boolean hasSufficientParams()
getParamCount()
is greater-or-equal-to
getParamCountRequired()
)?
public boolean hasVarArgs()
public boolean hasFixedArgs()
public boolean isDeferred()
public java.lang.Object getResult(javax.el.ELContext context)
context
- the EL context (may be needed to construct error messages).
public java.lang.Object getResultOrSelf(javax.el.ELContext context)
this
so more parameters can be applied
later. This is the normal behavour that the FunctorELResolver
will invoke for each additional parameter.
context
- the EL context (may be needed to construct error messages).public java.lang.Object applyParam(javax.el.ELContext context, java.lang.Object property)
getResultOrSelf(javax.el.ELContext)
.
context
- the EL context (may be needed to construct error messages).property
- the next property value to apply (either another parameter or
the "result" indicator).
public java.lang.Object applyParams(javax.el.ELContext context, java.lang.Object... params)
context
- the EL context (may be needed to construct error messages).params
- the set of parameters to apply.
public java.lang.Class<?> getAllowedParamType()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String action()
public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent toValidate, java.lang.Object value)
public void processValueChange(javax.faces.event.ValueChangeEvent event) throws javax.faces.event.AbortProcessingException
event
- the triggering event.
javax.faces.event.AbortProcessingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |