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:
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleaneval()voidsetDatetime1(String date) Sets the first date/timestamp, required.voidsetDatetime2(String date) Sets the other date/time stamp, required.voidSets the format of the datetimes, this is a required attribute.voidsetLenient(boolean b) Sets whether the datetime parser should use lenient parsing.Methods inherited from class org.apache.tools.ant.taskdefs.condition.IsTrue
setValueMethods inherited from class org.apache.tools.ant.ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProject
-
Constructor Details
-
DateTimeBefore
public DateTimeBefore()
-
-
Method Details
-
setDatetime1
Sets the first date/timestamp, required.- Parameters:
date- a string representing a date or time.
-
setDatetime2
Sets the other date/time stamp, required.- Parameters:
date- a string representing a date or time.
-
setFormat
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:
evalin interfaceorg.apache.tools.ant.taskdefs.condition.Condition- Overrides:
evalin 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
-