Package org.apache.tools.ant.taskdefs
Class Tstamp
- java.lang.Object
- 
- org.apache.tools.ant.ProjectComponent
- 
- org.apache.tools.ant.Task
- 
- org.apache.tools.ant.taskdefs.Tstamp
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Cloneable
 
 public class Tstamp extends Task Sets properties to the current time, or offsets from the current time. The default properties are TSTAMP, DSTAMP and TODAY;- Since:
- Ant 1.1
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description classTstamp.CustomFormatThis nested element that allows a property to be set to the current date and time in a given format.static classTstamp.Unitset of valid units to use for time offsets.
 - 
Field Summary- 
Fields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
 
- 
 - 
Constructor SummaryConstructors Constructor Description Tstamp()
 - 
Method SummaryModifier and Type Method Description Tstamp.CustomFormatcreateFormat()create a custom format with the current prefix.voidexecute()create the timestamps.protected java.util.DategetNow()Return theDateinstance to use as base for DSTAMP, TSTAMP and TODAY.protected java.util.Optional<java.util.Date>getNow(java.lang.String propertyName, java.util.function.Function<java.lang.String,java.util.Date> map, java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.String> log)Checks and returns a Date if the specified property is set.voidsetPrefix(java.lang.String prefix)Set a prefix for the properties.- 
Methods inherited from class org.apache.tools.ant.TaskbindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, log, log, maybeConfigure, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 - 
Methods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
 
- 
 
- 
- 
- 
Method Detail- 
setPrefixpublic void setPrefix(java.lang.String prefix) Set a prefix for the properties. If the prefix does not end with a "." one is automatically added.- Parameters:
- prefix- the prefix to use.
- Since:
- Ant 1.5
 
 - 
executepublic void execute() throws BuildExceptioncreate the timestamps. Custom ones are done before the standard ones, to get their retaliation in early.- Overrides:
- executein class- Task
- Throws:
- BuildException- on error.
 
 - 
createFormatpublic Tstamp.CustomFormat createFormat() create a custom format with the current prefix.- Returns:
- a ready to fill-in format
 
 - 
getNowprotected java.util.Date getNow() Return theDateinstance to use as base for DSTAMP, TSTAMP and TODAY.- Returns:
- Date
 
 - 
getNowprotected java.util.Optional<java.util.Date> getNow(java.lang.String propertyName, java.util.function.Function<java.lang.String,java.util.Date> map, java.util.function.BiFunction<java.lang.String,java.lang.String,java.lang.String> log)Checks and returns a Date if the specified property is set.- Parameters:
- propertyName- name of the property to check
- map- conversion of the property value as string to Date
- log- supplier of the log message containing the property name and value if the conversion fails
- Returns:
- Optional containing the Date or null
 
 
- 
 
-