org.oddjob.values.types
Class DateType
java.lang.Object
org.oddjob.values.types.DateType
- public class DateType
- extends java.lang.Object
- Description:
- Allows a date to be specified in different formats.
Dates can also be specified directly as a ValueType
without the need for this type but
must be a fixed format currently fixed at dd-MMM-yyyy.
For more information on format see
http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.html.
- Example:
<sequential>
<variables id="vars">
<date name="xmas" format="dd/MM/yy" date="25/12/05"/>
</variables>
<echo text="Christmas will start at ${vars.xmas}"/>
</sequential>
- Author:
- Rob Gordon.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DateType
public DateType()
valueFor
public java.util.Date valueFor(java.lang.Class required)
throws java.text.ParseException
- Resolve this type.
- Parameters:
required - The desired result class.
- Returns:
- A date or null.
- Throws:
java.text.ParseException - If the date string can't be converted to a date.
setDate
public void setDate(java.lang.String date)
getDate
public java.lang.String getDate()
setTimeZone
public void setTimeZone(java.lang.String timeZoneId)
getTimeZone
public java.lang.String getTimeZone()
toString
public java.lang.String toString()