javax.faces.validator
Class DoubleRangeValidator

java.lang.Object
  extended by javax.faces.validator.DoubleRangeValidator
All Implemented Interfaces:
EventListener, PartialStateHolder, StateHolder, Validator

@JSFValidator(name="f:validateDoubleRange",
              bodyContent="empty",
              tagClass="org.apache.myfaces.taglib.core.ValidateDoubleRangeTag")
@JSFJspProperty(name="binding",
                returnType="javax.faces.validator.DoubleRangeValidator",
                longDesc="A ValueExpression that evaluates to a DoubleRangeValidator.")
public class DoubleRangeValidator
extends Object
implements Validator, PartialStateHolder

Creates a validator and associateds it with the nearest parent UIComponent. When invoked, the validator ensures that values are valid doubles that lie within the minimum and maximum values specified. Commonly associated with a h:inputText entity. Unless otherwise specified, all attributes accept static values or EL expressions. see Javadoc of JSF Specification

Version:
$Revision: 1187700 $ $Date: 2011-10-22 07:19:37 -0500 (Sat, 22 Oct 2011) $
Author:
Manfred Geiler (latest modification by $Author: bommel $), Thomas Spiegl

Field Summary
static String MAXIMUM_MESSAGE_ID
           
static String MINIMUM_MESSAGE_ID
           
static String NOT_IN_RANGE_MESSAGE_ID
           
static String TYPE_MESSAGE_ID
           
static String VALIDATOR_ID
           
 
Constructor Summary
DoubleRangeValidator()
           
DoubleRangeValidator(double maximum)
           
DoubleRangeValidator(double maximum, double minimum)
           
 
Method Summary
 void clearInitialState()
           
 boolean equals(Object o)
           
 double getMaximum()
          The largest value that should be considered valid.
 double getMinimum()
          The smallest value that should be considered valid.
 boolean initialStateMarked()
           
 boolean isTransient()
           
 void markInitialState()
           
 void restoreState(FacesContext context, Object state)
           
 Object saveState(FacesContext context)
           
 void setMaximum(double maximum)
           
 void setMinimum(double minimum)
           
 void setTransient(boolean transientValue)
           
 void validate(FacesContext facesContext, UIComponent uiComponent, Object value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VALIDATOR_ID

public static final String VALIDATOR_ID
See Also:
Constant Field Values

MAXIMUM_MESSAGE_ID

public static final String MAXIMUM_MESSAGE_ID
See Also:
Constant Field Values

MINIMUM_MESSAGE_ID

public static final String MINIMUM_MESSAGE_ID
See Also:
Constant Field Values

TYPE_MESSAGE_ID

public static final String TYPE_MESSAGE_ID
See Also:
Constant Field Values

NOT_IN_RANGE_MESSAGE_ID

public static final String NOT_IN_RANGE_MESSAGE_ID
See Also:
Constant Field Values
Constructor Detail

DoubleRangeValidator

public DoubleRangeValidator()

DoubleRangeValidator

public DoubleRangeValidator(double maximum)

DoubleRangeValidator

public DoubleRangeValidator(double maximum,
                            double minimum)
Method Detail

validate

public void validate(FacesContext facesContext,
                     UIComponent uiComponent,
                     Object value)
              throws ValidatorException
Specified by:
validate in interface Validator
Throws:
ValidatorException

getMaximum

@JSFProperty(deferredValueType="java.lang.Double")
public double getMaximum()
The largest value that should be considered valid.


setMaximum

public void setMaximum(double maximum)

getMinimum

@JSFProperty(deferredValueType="java.lang.Double")
public double getMinimum()
The smallest value that should be considered valid.


setMinimum

public void setMinimum(double minimum)

saveState

public Object saveState(FacesContext context)
Specified by:
saveState in interface StateHolder

restoreState

public void restoreState(FacesContext context,
                         Object state)
Specified by:
restoreState in interface StateHolder

isTransient

public boolean isTransient()
Specified by:
isTransient in interface StateHolder

setTransient

public void setTransient(boolean transientValue)
Specified by:
setTransient in interface StateHolder

equals

public boolean equals(Object o)
Overrides:
equals in class Object

clearInitialState

public void clearInitialState()
Specified by:
clearInitialState in interface PartialStateHolder

initialStateMarked

public boolean initialStateMarked()
Specified by:
initialStateMarked in interface PartialStateHolder

markInitialState

public void markInitialState()
Specified by:
markInitialState in interface PartialStateHolder


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.