Class DateType.DateFormat
java.lang.Object
org.simpleframework.xml.transform.DateType.DateFormat
- Enclosing class:
DateType
The
DateFormat
provides a synchronized means for
using the simple date format object. It ensures that should
there be many threads trying to gain access to the formatter
that they will not collide causing a race condition.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SimpleDateFormat
This is the simple date format used to parse the string. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
format
This is the simple date format used to parse the string.
-
-
Constructor Details
-
DateFormat
Constructor for theDateFormat
object. This will wrap a simple date format, providing access to the conversion functions which allow date to string and string to date.- Parameters:
format
- this is the pattern to use for the date type
-
-
Method Details
-
getText
This is used to provide a transformation from a date to a string. It ensures that there is a bidirectional transformation process which allows dates to be serialized and deserialized with XML.- Parameters:
date
- this is the date to be converted to a string value- Returns:
- returns the string that has be converted from a date
- Throws:
Exception
-
getDate
This is used to provide a transformation from a string to a date. It ensures that there is a bidirectional transformation process which allows dates to be serialized and deserialized with XML.- Parameters:
text
- this is the string to be converted to a date value- Returns:
- returns the date that has be converted from a string
- Throws:
Exception
-