com.codestreet.messageforge
Class RFldConstraintDatetimeMinMax

java.lang.Object
  extended bycom.codestreet.messageforge.RFldConstraintDatetime
      extended bycom.codestreet.messageforge.RFldConstraintDatetimeMinMax
All Implemented Interfaces:
RFldConstraint

public class RFldConstraintDatetimeMinMax
extends RFldConstraintDatetime

Class to represent a minumum/maximum date constraint on a datetime message field.

Author:
Jawaid Hakim.

Field Summary
protected  java.util.Date maxDate_
          Maximum date allowed.
protected  boolean maxSet_
           
protected  java.util.Date minDate_
          Minimum date allowed.
protected  boolean minSet_
           
 
Method Summary
 java.lang.String errDesc(java.lang.String fldName)
          Get error description.
 boolean isValid(java.util.Date val)
          Check if a value satisfies the constraint.
static RFldConstraintDatetimeMinMax valueOf(java.lang.String key, java.lang.String fldName, boolean minSet, java.util.Date min, boolean maxSet, java.util.Date max)
          Factory.
 
Methods inherited from class com.codestreet.messageforge.RFldConstraintDatetime
isValid, validate, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

minDate_

protected java.util.Date minDate_
Minimum date allowed.


maxDate_

protected java.util.Date maxDate_
Maximum date allowed.


minSet_

protected boolean minSet_

maxSet_

protected boolean maxSet_
Method Detail

valueOf

public static RFldConstraintDatetimeMinMax valueOf(java.lang.String key,
                                                   java.lang.String fldName,
                                                   boolean minSet,
                                                   java.util.Date min,
                                                   boolean maxSet,
                                                   java.util.Date max)
                                            throws FieldValidationException
Factory. Returns a RFldConstraintDatetimeMinMax instance based on the input parameters.

Parameters:
key - Key to use for caching constraint.
fldName - Name of field to which this constraint is bound.
minSet - Flag to indicate whether min value is set.
min - Minimum date allowed. If this is null then no constraint is placed on the minimum date.
maxSet - Flag to indicate whether max value is set.
max - Maximum date allowed. If this is null then no constraint is placed on the maximum date.
Throws:
FieldValidationException

errDesc

public java.lang.String errDesc(java.lang.String fldName)
Get error description.

Parameters:
fldName - Field name.
Returns:
Error description.

isValid

public boolean isValid(java.util.Date val)
Check if a value satisfies the constraint.

Specified by:
isValid in class RFldConstraintDatetime
Parameters:
val - Data to validate.
Returns:
true if the data satisfied the constraint. Otherwise, false is returned.


Copyright © 2003-2006 CodeStreet. All Rights Reserved.