Class DateTimeBefore

  • All Implemented Interfaces:
    java.lang.Cloneable, org.apache.tools.ant.taskdefs.condition.Condition

    public class DateTimeBefore
    extends org.apache.tools.ant.taskdefs.condition.IsTrue
    implements org.apache.tools.ant.taskdefs.condition.Condition
    Condition that validates if one datetime is before another datetime.
    Version:
    $Revision: 132 $
    • Field Summary

      • Fields inherited from class org.apache.tools.ant.ProjectComponent

        description, location, project
    • Constructor Summary

      Constructors 
      Constructor Description
      DateTimeBefore()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean eval()  
      void setDatetime1​(java.lang.String date)
      Sets the first date/timestamp, required.
      void setDatetime2​(java.lang.String date)
      Sets the other date/time stamp, required.
      void setFormat​(java.lang.String format)
      Sets the format of the datetimes, this is a required attribute.
      void setLenient​(boolean b)
      Sets whether the datetime parser should use lenient parsing.
      • Methods inherited from class org.apache.tools.ant.taskdefs.condition.IsTrue

        setValue
      • Methods inherited from class org.apache.tools.ant.ProjectComponent

        clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateTimeBefore

        public DateTimeBefore()
    • Method Detail

      • setDatetime1

        public void setDatetime1​(java.lang.String date)
        Sets the first date/timestamp, required.
        Parameters:
        date - a string representing a date or time.
      • setDatetime2

        public void setDatetime2​(java.lang.String date)
        Sets the other date/time stamp, required.
        Parameters:
        date - a string representing a date or time.
      • setFormat

        public void setFormat​(java.lang.String format)
        Sets the format of the datetimes, this is a required attribute. See java.text.SimpleDateFormat for the format.
        Parameters:
        format - The new format value
      • setLenient

        public void setLenient​(boolean b)
        Sets whether the datetime parser should use lenient parsing. This is an optional setting, default is true, use lenient parsing.
        Parameters:
        b - The new lenient value
      • eval

        public boolean eval()
                     throws org.apache.tools.ant.BuildException
        Specified by:
        eval in interface org.apache.tools.ant.taskdefs.condition.Condition
        Overrides:
        eval in class org.apache.tools.ant.taskdefs.condition.IsTrue
        Returns:
        true if datetime1 is before datetime2.
        Throws:
        org.apache.tools.ant.BuildException - if the attributes are not set correctly