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

Quick Search    Search Deep

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

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

public class LongRangeValidator
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.Long _maximum
           
private  java.lang.Long _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
LongRangeValidator()
           
LongRangeValidator(long maximum)
           
LongRangeValidator(long maximum, long minimum)
           
 
Method Summary
 boolean equals(java.lang.Object o)
          Determine whether this Object is semantically equal to another Object.
 long getMaximum()
           
 long getMinimum()
           
 boolean isTransient()
           
private  long parseLongValue(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(long maximum)
           
 void setMinimum(long 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

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

VALIDATOR_ID

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

_minimum

private java.lang.Long _minimum

_maximum

private java.lang.Long _maximum

_transient

private boolean _transient
Constructor Detail

LongRangeValidator

public LongRangeValidator()

LongRangeValidator

public LongRangeValidator(long maximum)

LongRangeValidator

public LongRangeValidator(long maximum,
                          long 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

parseLongValue

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

getMaximum

public long getMaximum()

setMaximum

public void setMaximum(long maximum)

getMinimum

public long getMinimum()

setMinimum

public void setMinimum(long minimum)

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

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

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.