Package ise.antelope.tasks
Class DateTimeBefore
- java.lang.Object
-
- org.apache.tools.ant.ProjectComponent
-
- org.apache.tools.ant.taskdefs.condition.IsTrue
-
- ise.antelope.tasks.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 $
-
-
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.
-
-
-
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 interfaceorg.apache.tools.ant.taskdefs.condition.Condition
- Overrides:
eval
in classorg.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
-
-