JSF-Spring

de.mindmatters.faces.el
Class ConstantMethodBinding

java.lang.Object
  extended by javax.faces.el.MethodBinding
      extended by de.mindmatters.faces.el.ConstantMethodBinding
All Implemented Interfaces:
StateHolder

public final class ConstantMethodBinding
extends MethodBinding
implements StateHolder

Convenient method binding that does nothing other than returning a fixed outcome String when invoked.

Author:
Andreas Kuhrwahl

Constructor Summary
ConstantMethodBinding()
          Default constructor.
ConstantMethodBinding(java.lang.String action)
          Creates an method binding that takes a fixed outcome string action.
 
Method Summary
 java.lang.Class getType(FacesContext context)
          

Return the Java class representing the return type from the method identified by this method binding expression.

 java.lang.Object invoke(FacesContext context, java.lang.Object[] params)
          

Return the return value (if any) resulting from a call to the method identified by this method binding expression, passing it the specified parameters, relative to the specified FacesContext.

 boolean isTransient()
          

If true, the Object implementing this interface must not participate in state saving or restoring.

 void restoreState(FacesContext context, java.lang.Object state)
          

Perform any processing required to restore the state from the entries in the state Object.

 java.lang.Object saveState(FacesContext context)
          

Gets the state of the instance as a Serializable Object.

 void setTransient(boolean newTransientValue)
          

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

 
Methods inherited from class javax.faces.el.MethodBinding
getExpressionString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConstantMethodBinding

public ConstantMethodBinding()
Default constructor.


ConstantMethodBinding

public ConstantMethodBinding(java.lang.String action)
Creates an method binding that takes a fixed outcome string action.

Parameters:
action - The fixed outcome String
Method Detail

getType

public java.lang.Class getType(FacesContext context)

Return the Java class representing the return type from the method identified by this method binding expression.

Specified by:
getType in class MethodBinding
Parameters:
context - FacesContext for the current request

invoke

public java.lang.Object invoke(FacesContext context,
                               java.lang.Object[] params)

Return the return value (if any) resulting from a call to the method identified by this method binding expression, passing it the specified parameters, relative to the specified FacesContext.

Specified by:
invoke in class MethodBinding
Parameters:
context - FacesContext for the current request
params - Array of parameters to be passed to the called method, or null for no parameters

isTransient

public boolean isTransient()

If true, the Object implementing this interface must not participate in state saving or restoring.

Specified by:
isTransient in interface StateHolder

setTransient

public void setTransient(boolean newTransientValue)

Denotes whether or not the Object implementing this interface must or must not participate in state saving or restoring.

Specified by:
setTransient in interface StateHolder
Parameters:
newTransientValue - boolean pass true if this Object will participate in state saving or restoring, otherwise pass false.

saveState

public java.lang.Object saveState(FacesContext context)

Gets the state of the instance as a Serializable Object.

If the class that implements this interface has references to instances that implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.saveState(javax.faces.context.FacesContext) method on all those instances as well. This method must not save the state of children and facets. That is done via the StateManager

This method must not alter the state of the implementing object. In other words, after executing this code:

 Object state = component.saveState(facesContext);
 

component should be the same as before executing it.

The return from this method must be Serializable

Specified by:
saveState in interface StateHolder

restoreState

public void restoreState(FacesContext context,
                         java.lang.Object state)

Perform any processing required to restore the state from the entries in the state Object.

If the class that implements this interface has references to instances that also implement StateHolder (such as a UIComponent with event handlers, validators, etc.) this method must call the StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object) method on all those instances as well.

Specified by:
restoreState in interface StateHolder

JSF-Spring

Copyright © 2006 mindmatters GmbH & Co. KG