psdi.app.bulletinboard

Class FldDatePair

  • All Implemented Interfaces:
    MboConstants, MboValueListener
    Direct Known Subclasses:
    FldBBExpireDate, FldBBPostDate


    public abstract class FldDatePair
    extends MboValueAdapter
    This class provides behaviour to validate a pair of dates where the dates are interdependent on each other and each date cannot be earlier or later than the other Extend this class and pass the two date field names to the constructor.
    • Constructor Detail

      • FldDatePair

        public FldDatePair(MboValue mbv,
                           java.lang.String validateDate,
                           java.lang.String validateAgainstDate)
        Construct and attach to the specified mbo value
        Parameters:
        MboValue - - Instance of MboValue
        String - - Name of the Field being validated
        String - - Name of the Field that this field is being validated against
    • Method Detail

      • setCompareType

        protected void setCompareType(int ctype)
                               throws MXException,
                                      java.rmi.RemoteException
        Sets the type of validation needed.
        Parameters:
        ctype - - Integer value representing the comparison type. Use the constants COMPARE_TYPE_AFTER or COMPARE_TYPE_BEFORE. Default is COMPARE_TYPE_AFTER. COMPARE_TYPE_AFTER will test if validate date is after validateAgainst date and if true will throw an exception. COMPARE_TYPE_BEFORE will test if validate date is before validateAgainst date and if true will throw an exception.
        Throws:
        MXException
        java.rmi.RemoteException
      • setValidateErrorMessage

        protected void setValidateErrorMessage(java.lang.String resource,
                                               java.lang.String errorMessage)
                                        throws MXException,
                                               java.rmi.RemoteException
        Sets the error message to be displayed if the validation fails
        Parameters:
        resource - - The name of the resource file (.txt) where the message is located
        errorMessage - - The name of the message key
        Throws:
        MXException
        java.rmi.RemoteException