Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.faces.validator
Class DoubleRangeValidator  view DoubleRangeValidator download DoubleRangeValidator.java

java.lang.Object
  extended byjavax.faces.validator.DoubleRangeValidator
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.StateHolder, Validator

public class DoubleRangeValidator
extends java.lang.Object
implements Validator, javax.faces.component.StateHolder

Version:
$Revision: 169646 $ $Date: 2005-05-11 11:34:57 -0400 (Wed, 11 May 2005) $

Field Summary
private  java.lang.Double _maximum
           
private  java.lang.Double _minimum
           
private  boolean _transient
           
static java.lang.String MAXIMUM_MESSAGE_ID
           
static java.lang.String MINIMUM_MESSAGE_ID
           
static java.lang.String TYPE_MESSAGE_ID
           
static java.lang.String VALIDATOR_ID
           
 
Fields inherited from interface javax.faces.validator.Validator
NOT_IN_RANGE_MESSAGE_ID
 
Constructor Summary
DoubleRangeValidator()
           
DoubleRangeValidator(double maximum)
           
DoubleRangeValidator(double maximum, double minimum)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Determine whether this Object is semantically equal to another Object.
 double getMaximum()
           
 double getMinimum()
           
 boolean isTransient()
           
private  double parseDoubleValue(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, java.lang.Object value)
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setMaximum(double maximum)
           
 void setMinimum(double minimum)
           
 void setTransient(boolean transientValue)
           
 void validate(javax.faces.context.FacesContext facesContext, javax.faces.component.UIComponent uiComponent, java.lang.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 java.lang.String VALIDATOR_ID
See Also:
Constant Field Values

MAXIMUM_MESSAGE_ID

public static final java.lang.String MAXIMUM_MESSAGE_ID
See Also:
Constant Field Values

MINIMUM_MESSAGE_ID

public static final java.lang.String MINIMUM_MESSAGE_ID
See Also:
Constant Field Values

TYPE_MESSAGE_ID

public static final java.lang.String TYPE_MESSAGE_ID
See Also:
Constant Field Values

_minimum

private java.lang.Double _minimum

_maximum

private java.lang.Double _maximum

_transient

private boolean _transient
Constructor Detail

DoubleRangeValidator

public DoubleRangeValidator()

DoubleRangeValidator

public DoubleRangeValidator(double maximum)

DoubleRangeValidator

public DoubleRangeValidator(double maximum,
                            double minimum)
Method Detail

validate

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

parseDoubleValue

private double parseDoubleValue(javax.faces.context.FacesContext facesContext,
                                javax.faces.component.UIComponent uiComponent,
                                java.lang.Object value)
                         throws ValidatorException

getMaximum

public double getMaximum()

setMaximum

public void setMaximum(double maximum)

getMinimum

public double getMinimum()

setMinimum

public void setMinimum(double minimum)

saveState

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

restoreState

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

isTransient

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

setTransient

public void setTransient(boolean transientValue)
Specified by:
setTransient in interface javax.faces.component.StateHolder

equals

public boolean equals(java.lang.Object o)
Description copied from class: java.lang.Object
Determine whether this Object is semantically equal to another Object.

There are some fairly strict requirements on this method which subclasses must follow:

  • It must be transitive. If a.equals(b) and b.equals(c), then a.equals(c) must be true as well.
  • It must be symmetric. a.equals(b) and b.equals(a) must have the same value.
  • It must be reflexive. a.equals(a) must always be true.
  • It must be consistent. Whichever value a.equals(b) returns on the first invocation must be the value returned on all later invocations.
  • a.equals(null) must be false.
  • It must be consistent with hashCode(). That is, a.equals(b) must imply a.hashCode() == b.hashCode(). The reverse is not true; two objects that are not equal may have the same hashcode, but that has the potential to harm hashing performance.

This is typically overridden to throw a java.lang.ClassCastException if the argument is not comparable to the class performing the comparison, but that is not a requirement. It is legal for a.equals(b) to be true even though a.getClass() != b.getClass(). Also, it is typical to never cause a java.lang.NullPointerException.

In general, the Collections API (java.util) use the equals method rather than the == operator to compare objects. However, java.util.IdentityHashMap is an exception to this rule, for its own good reasons.

The default implementation returns this == o.