com.guiseframework.validator
Class AbstractRangeValidator<V>

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.event.GuiseBoundPropertyObject
          extended by com.guiseframework.validator.AbstractValidator<V>
              extended by com.guiseframework.validator.AbstractRangeValidator<V>
Type Parameters:
V - The value type this validator supports.
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, RangeValidator<V>, Validator<V>
Direct Known Subclasses:
AbstractComparableRangeValidator

public abstract class AbstractRangeValidator<V>
extends AbstractValidator<V>
implements RangeValidator<V>

An abstract implementation of a validator restricted to a range. The step value is considered relative either to the minimum value, if available, the maximum value, if available, or zero, in that order or priority.

Author:
Garret Wilson

Field Summary
 
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
 
Fields inherited from interface com.guiseframework.validator.Validator
INVALID_VALUE_MESSAGE_PROPERTY, VALUE_REQUIRED_MESSAGE_PROPERTY, VALUE_REQUIRED_PROPERTY
 
Constructor Summary
AbstractRangeValidator(V minimum, V maximum, V step, boolean valueRequired)
          Minimum, maximum, step, and value required constructor.
 
Method Summary
 V getMaximum()
           
 V getMinimum()
           
 V getStep()
           
 
Methods inherited from class com.guiseframework.validator.AbstractValidator
getInvalidValueMessage, getValueRequiredMessage, isValid, isValueRequired, setInvalidValueMessage, setValueRequired, setValueRequiredMessage, throwInvalidValueValidationException, throwValueRequiredValidationException, toString, validate
 
Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject
getSession
 
Methods inherited from class com.globalmentor.beans.BoundPropertyObject
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.guiseframework.validator.Validator
getInvalidValueMessage, getSession, getValueRequiredMessage, isValid, setInvalidValueMessage, setValueRequiredMessage, validate
 
Methods inherited from interface com.globalmentor.beans.PropertyBindable
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 

Constructor Detail

AbstractRangeValidator

public AbstractRangeValidator(V minimum,
                              V maximum,
                              V step,
                              boolean valueRequired)
Minimum, maximum, step, and value required constructor.

Parameters:
minimum - The minimum value, inclusive, or null if the range has no lower bound.
maximum - The maximum value, inclusive, or null if the range has no upper bound.
step - The step amount, or null if the range has no increment value specified.
valueRequired - Whether the value must be non-null in order to be considered valid.
Method Detail

getMinimum

public V getMinimum()
Specified by:
getMinimum in interface RangeValidator<V>
Returns:
The minimum value, inclusive, or null if the range has no lower bound.

getMaximum

public V getMaximum()
Specified by:
getMaximum in interface RangeValidator<V>
Returns:
The maximum value, inclusive, or null if the range has no upper bound.

getStep

public V getStep()
Specified by:
getStep in interface RangeValidator<V>
Returns:
The step amount, or null if the range has no increment value specified.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.