oracle.adf.view.faces.validator
Class DateTimeRangeValidator

java.lang.Object
  |
  +--oracle.adf.view.faces.validator.DateTimeRangeValidator
All Implemented Interfaces:
java.util.EventListener, javax.faces.component.StateHolder, javax.faces.validator.Validator

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

DateTimeRangeValidator is a Validator that checks the value of the corresponding component against specified minimum and maximum dates. The following algorithm is implemented:


Field Summary
static java.lang.String MAXIMUM_MESSAGE_ID
          The message identifier of the FacesMessage to be created if the maximum value check fails.
static java.lang.String MINIMUM_MESSAGE_ID
          The message identifier of the FacesMessage to be created if the minimum value check fails.
static java.lang.String NOT_IN_RANGE_MESSAGE_ID
          The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set.
static java.lang.String TYPE_MESSAGE_ID
          The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type.
static java.lang.String VALIDATOR_ID
           
 
Constructor Summary
DateTimeRangeValidator()
          Construct a Validator with no preconfigured limits.
DateTimeRangeValidator(java.util.Date maximum)
          Construct a Validator with the specified preconfigured limit.
DateTimeRangeValidator(java.util.Date maximum, java.util.Date minimum)
          Construct a Validator with the specified preconfigured limits.
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.util.Date getMaximum()
          Return the maximum value to be enforced by this Validator or null if it has not been set.
 java.util.Date getMinimum()
          Return the minimum value to be enforced by this Validator, or null if it has not been set.
 int hashCode()
           
 boolean isTransient()
           
 void restoreState(javax.faces.context.FacesContext context, java.lang.Object state)
           
 java.lang.Object saveState(javax.faces.context.FacesContext context)
           
 void setMaximum(java.util.Date maximum)
          Set the maximum value to be enforced by this Validator.
 void setMinimum(java.util.Date minimum)
          Set the minimum value to be enforced by this Validator.
 void setTransient(boolean transientValue)
           
 void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, java.lang.Object value)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, 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
The message identifier of the FacesMessage to be created if the maximum value check fails. The message format string for this message may optionally include a {0} placeholder, which will be replaced by the configured maximum value.

See Also:
Constant Field Values

MINIMUM_MESSAGE_ID

public static final java.lang.String MINIMUM_MESSAGE_ID
The message identifier of the FacesMessage to be created if the minimum value check fails. The message format string for this message may optionally include a {0} placeholder, which will be replaced by the configured minimum value.

See Also:
Constant Field Values

NOT_IN_RANGE_MESSAGE_ID

public static final java.lang.String NOT_IN_RANGE_MESSAGE_ID
The message identifier of the FacesMessage to be created if the maximum or minimum value check fails, and both the maximum and minimum values for this validator have been set. The message format string for this message may optionally include a {0} placeholder, which will be replaced by the configured minimum value, and a {1} placeholder, which will be replaced by the configured maximum value.

See Also:
Constant Field Values

TYPE_MESSAGE_ID

public static final java.lang.String TYPE_MESSAGE_ID
The message identifier of the FacesMessage to be created if the current value of this component is not of the correct type.

See Also:
Constant Field Values
Constructor Detail

DateTimeRangeValidator

public DateTimeRangeValidator()
Construct a Validator with no preconfigured limits.


DateTimeRangeValidator

public DateTimeRangeValidator(java.util.Date maximum)
Construct a Validator with the specified preconfigured limit.

Parameters:
maximum - Maximum value to allow

DateTimeRangeValidator

public DateTimeRangeValidator(java.util.Date maximum,
                              java.util.Date minimum)
Construct a Validator with the specified preconfigured limits.

Parameters:
maximum - Maximum value to allow
minimum - Minimum value to allow
Method Detail

getMaximum

public java.util.Date getMaximum()
Return the maximum value to be enforced by this Validator or null if it has not been set.


setMaximum

public void setMaximum(java.util.Date maximum)
Set the maximum value to be enforced by this Validator.

Parameters:
maximum - The new maximum value

getMinimum

public java.util.Date getMinimum()
Return the minimum value to be enforced by this Validator, or null if it has not been set.


setMinimum

public void setMinimum(java.util.Date minimum)
Set the minimum value to be enforced by this Validator.

Parameters:
minimum - The new minimum value

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:
java.lang.NullPointerException
javax.faces.validator.ValidatorException

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)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

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


Copyright © 2003-2004 Oracle Corporation. All Rights Reserved.