com.ibm.xsp.validator
Class RequiredValidator

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

public class RequiredValidator
extends AbstractValidator
implements FacesRequiredValidator

The "xp:validateRequired" tag used in the XPage source. Provides an application designer's error message for when required values are not present.


Field Summary
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
RequiredValidator()
           
 
Method Summary
 java.lang.String getInvalidMessage()
          Return message that informs use that value is required
 java.lang.String getRequiredMessage()
          null or the required error message to display when the required value is not present.
protected  boolean isEmpty(java.lang.Object value)
          Return true if the value is empty (where "empty" is defined as null or a zero-length String.)
 void setComponent(javax.faces.component.UIComponent component)
          This will be called while constructing the component and the UIComponent tree, so no processing should be performed at this stage.
 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, restoreState, saveState, setMessage
 
Methods inherited from class com.ibm.xsp.complex.ValueBindingObjectImpl
getComponent, getFacesContext, getValueBinding, isTransient, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequiredValidator

public RequiredValidator()
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

setComponent

public void setComponent(javax.faces.component.UIComponent component)
Description copied from interface: ComponentBindingObject
This will be called while constructing the component and the UIComponent tree, so no processing should be performed at this stage.

Specified by:
setComponent in interface ComponentBindingObject
Overrides:
setComponent in class ValueBindingObjectImpl

getInvalidMessage

public java.lang.String getInvalidMessage()
Return message that informs use that value is required

Returns:
message that value is required

getRequiredMessage

public java.lang.String getRequiredMessage()
Description copied from interface: FacesRequiredValidator
null or the required error message to display when the required value is not present. If null, the infrastructure message will be used.

Specified by:
getRequiredMessage in interface FacesRequiredValidator
Returns:
message to display when value is required

isEmpty

protected boolean isEmpty(java.lang.Object value)
Return true if the value is empty (where "empty" is defined as null or a zero-length String.)