com.ibm.xsp.validator
Class ValidatorMethodBinding

java.lang.Object
  extended by com.ibm.xsp.complex.ValueBindingObjectImpl
      extended by com.ibm.xsp.validator.AbstractValidator
          extended by com.ibm.xsp.validator.ValidatorMethodBinding
All Implemented Interfaces:
ComponentBindingObject, ValueBindingObject, java.util.EventListener, javax.faces.component.StateHolder, javax.faces.validator.Validator

public class ValidatorMethodBinding
extends AbstractValidator
implements javax.faces.component.StateHolder

This is used to add a method binding to the EditableValueHolder.getValidators() list. If only one method binding is required, then EditableValueHolder.setValidator(javax.faces.el.MethodBinding) can be used. Otherwise, this class and its corresponding tag allow adding multiple validator method bindings, by placing multiple instances of this tag in the list. This is the xp:customValidator tag.


Field Summary
static java.lang.String[] PARAM_NAMES
           
static java.lang.Class<?>[] PARAM_TYPES
           
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
ValidatorMethodBinding()
           
 
Method Summary
 java.lang.String getInvalidMessage()
           
 javax.faces.el.MethodBinding getValidate()
          Returns the validate method binding.
 boolean isTransient()
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setTransient(boolean transientFlag)
           
 void setValidate(javax.faces.el.MethodBinding validate)
          Returns the validate method binding.
 void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value)
           
 
Methods inherited from class com.ibm.xsp.validator.AbstractValidator
addInputInvalidMessage, createNullContextOrComponentEx, createValidatorEx, getInvalidRangeMessage, getMessage, getNotCorrectTypeMessage, setMessage
 
Methods inherited from class com.ibm.xsp.complex.ValueBindingObjectImpl
getComponent, getFacesContext, getValueBinding, setComponent, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARAM_NAMES

public static final java.lang.String[] PARAM_NAMES

PARAM_TYPES

public static final java.lang.Class<?>[] PARAM_TYPES
Constructor Detail

ValidatorMethodBinding

public ValidatorMethodBinding()
Method Detail

validate

public void validate(javax.faces.context.FacesContext context,
                     javax.faces.component.UIComponent component,
                     java.lang.Object value)
              throws javax.faces.validator.ValidatorException
Specified by:
validate in interface javax.faces.validator.Validator
Throws:
javax.faces.validator.ValidatorException

getInvalidMessage

public java.lang.String getInvalidMessage()

getValidate

public javax.faces.el.MethodBinding getValidate()
Returns the validate method binding.

Returns:
Returns the validate method binding.

setValidate

public void setValidate(javax.faces.el.MethodBinding validate)
Returns the validate method binding.

Parameters:
validate - mathodBinding

saveState

public java.lang.Object saveState(javax.faces.context.FacesContext context)
Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractValidator

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         java.lang.Object state)
Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractValidator

isTransient

public boolean isTransient()
Specified by:
isTransient in interface javax.faces.component.StateHolder
Overrides:
isTransient in class ValueBindingObjectImpl

setTransient

public void setTransient(boolean transientFlag)
Specified by:
setTransient in interface javax.faces.component.StateHolder
Overrides:
setTransient in class ValueBindingObjectImpl