public class XMLDurationFormatter extends java.lang.Object implements ValueFormatter<uk.ac.ed.epcc.webapp.model.data.Duration>
Duration object so that it is represented as an XML duration.
XML Durations may contain units in months and years. As their length of time
in hours, minutes and seconds is ambiguous, this formatter will never use
such units| Modifier and Type | Field and Description |
|---|---|
static XMLDurationFormatter |
FORMATTER
Useful static instance of this object to be used when one doesn't want to
generate lots of formatters when one will suffice
|
| Constructor and Description |
|---|
XMLDurationFormatter() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
format(uk.ac.ed.epcc.webapp.model.data.Duration duration)
Formats the duration as an XML duration.
|
java.lang.Class<uk.ac.ed.epcc.webapp.model.data.Duration> |
getType()
Returns the
Class all objects acceptable as input to the format method must be
assignable to. |
public static final XMLDurationFormatter FORMATTER
public java.lang.String format(uk.ac.ed.epcc.webapp.model.data.Duration duration)
format in interface ValueFormatter<uk.ac.ed.epcc.webapp.model.data.Duration>duration - The object to formatValueFormatter.format(java.lang.Object)public java.lang.Class<uk.ac.ed.epcc.webapp.model.data.Duration> getType()
ValueFormatterClass all objects acceptable as input to the format method must be
assignable to.getType in interface ValueFormatter<uk.ac.ed.epcc.webapp.model.data.Duration>ValueFormatter