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
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionclassThis nested element that allows a property to be set to the current date and time in a given format.static classset of valid units to use for time offsets.
- 
Field SummaryFields inherited from class org.apache.tools.ant.ProjectComponentdescription, location, project
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncreate a custom format with the current prefix.voidexecute()create the timestamps.protected DategetNow()Return theDateinstance to use as base for DSTAMP, TSTAMP and TODAY.Checks and returns a Date if the specified property is set.voidSet 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, setTaskTypeMethods inherited from class org.apache.tools.ant.ProjectComponentclone, getDescription, getLocation, getProject, setDescription, setLocation, setProject
- 
Constructor Details- 
Tstamppublic Tstamp()
 
- 
- 
Method Details- 
setPrefixSet 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
 
- 
executecreate the timestamps. Custom ones are done before the standard ones, to get their retaliation in early.- Overrides:
- executein class- Task
- Throws:
- BuildException- on error.
 
- 
createFormatcreate a custom format with the current prefix.- Returns:
- a ready to fill-in format
 
- 
getNow
- 
getNowprotected Optional<Date> getNow(String propertyName, Function<String, Date> map, BiFunction<String, String, 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
 
 
-