Class DateTimeBefore

java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.IsTrue
ise.antelope.tasks.DateTimeBefore
All Implemented Interfaces:
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
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    Sets the first date/timestamp, required.
    void
    Sets the other date/time stamp, required.
    void
    setFormat(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 Details

    • DateTimeBefore

      public DateTimeBefore()
  • Method Details

    • setDatetime1

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

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

      public void setFormat(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