org.apache.shale.validator.validator
Class DoubleValidator

java.lang.Object
  extended by org.apache.shale.validator.util.AbstractUtilities
      extended by org.apache.shale.validator.validator.AbstractValidator
          extended by org.apache.shale.validator.validator.DoubleValidator
All Implemented Interfaces:
EventListener, javax.faces.component.StateHolder, javax.faces.validator.Validator

public final class DoubleValidator
extends AbstractValidator
implements javax.faces.component.StateHolder

Validator implementation that will perform both format and (optional) range checks on a Double value.


Field Summary
 
Fields inherited from class org.apache.shale.validator.validator.AbstractValidator
ARG_VALUE, helper, MAXIMUM_VALUE, MINIMUM_VALUE, SUBMITTED_VALUE
 
Fields inherited from class org.apache.shale.validator.util.AbstractUtilities
DEFAULT_RESOURCE_BUNDLE
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
DoubleValidator()
           
 
Method Summary
 double getMaximum()
          Return the configured maximum value for this validator.
 double getMinimum()
          Return the configured minimum value for this validator.
 void restoreState(javax.faces.context.FacesContext context, Object state)
          
 Object saveState(javax.faces.context.FacesContext context)
          
 void setMaximum(double maximum)
          Set the configured maximum value for this validator.
 void setMinimum(double minimum)
          Set the configured minimum value for this validator.
 void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, Object value)
          

Perform the correctness checks implemented by this Validator against the specified UIComponent.

 
Methods inherited from class org.apache.shale.validator.validator.AbstractValidator
actions, convert, isClient, resources, setClient, validate
 
Methods inherited from class org.apache.shale.validator.util.AbstractUtilities
getMessage, isTransient, message, message, message, setMessage, setTransient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.StateHolder
isTransient, setTransient
 

Constructor Detail

DoubleValidator

public DoubleValidator()
Method Detail

getMaximum

public double getMaximum()

Return the configured maximum value for this validator.


setMaximum

public void setMaximum(double maximum)

Set the configured maximum value for this validator.

Parameters:
maximum - The new maximum value

getMinimum

public double getMinimum()

Return the configured minimum value for this validator.


setMinimum

public void setMinimum(double minimum)

Set the configured minimum value for this validator.

Parameters:
minimum - The new minimum value

validate

public void validate(javax.faces.context.FacesContext context,
                     javax.faces.component.UIComponent component,
                     Object value)
              throws javax.faces.validator.ValidatorException

Perform the correctness checks implemented by this Validator against the specified UIComponent. If any violations are found, a ValidatorException will be thrown containing the FacesMessage describing the failure.

IMPLEMENTATION NOTE: Unlike earlier implementations of Shale Validator integration, validators that subclass this class do not support the option to skip server side validation.

Specified by:
validate in interface javax.faces.validator.Validator
Specified by:
validate in class AbstractValidator
Parameters:
context - FacesContext for the current request
component - UIComponent we are checking for correctness
value - The value to validate
Throws:
javax.faces.validator.ValidatorException - if validation fails

restoreState

public void restoreState(javax.faces.context.FacesContext context,
                         Object state)

Specified by:
restoreState in interface javax.faces.component.StateHolder
Overrides:
restoreState in class AbstractValidator

saveState

public Object saveState(javax.faces.context.FacesContext context)

Specified by:
saveState in interface javax.faces.component.StateHolder
Overrides:
saveState in class AbstractValidator


Copyright © 2004-2007 Apache Software Foundation. All Rights Reserved.