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

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 Summary
 class Tstamp.CustomFormat
          This nested element that allows a property to be set to the current date and time in a given format.
static class Tstamp.Unit
          set of valid units to use for time offsets.
 
Field Summary
 
Fields inherited from class org.apache.tools.ant.Task
description, location, target, taskName, taskType, wrapper
 
Fields inherited from class org.apache.tools.ant.ProjectComponent
project
 
Constructor Summary
Tstamp()
           
 
Method Summary
 Tstamp.CustomFormat createFormat()
          create a custom format with the current prefix.
 void execute()
          create the timestamps.
 void setPrefix(java.lang.String prefix)
          Set a prefix for the properties.
 
Methods inherited from class org.apache.tools.ant.Task
getDescription, getLocation, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, init, isInvalid, log, log, maybeConfigure, perform, reconfigure, setDescription, setLocation, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskType
 
Methods inherited from class org.apache.tools.ant.ProjectComponent
getProject, setProject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Tstamp

public Tstamp()
Method Detail

setPrefix

public void setPrefix(java.lang.String prefix)
Set a prefix for the properties. If the prefix does not end with a "." one is automatically added

Since:
Ant 1.5

execute

public void execute()
             throws BuildException
create the timestamps. Custom ones are done before the standard ones, to get their retaliation in early.

Overrides:
execute in class Task
Throws:
BuildException

createFormat

public Tstamp.CustomFormat createFormat()
create a custom format with the current prefix.

Returns:
a ready to fill-in format


Copyright 2000-2005 Apache Software Foundation. All Rights Reserved.