polish
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2305 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
bc9ef36f26
commit
35aefbb932
|
|
@ -22,6 +22,7 @@ import java.lang.annotation.Target;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declares that a field should be formatted as a ISO date time.
|
* Declares that a field should be formatted as a ISO date time.
|
||||||
|
* Can be applied to <code>java.util.Date</code>, <code>java.util.Calendar</code>, <code>java.long.Long</code>, or Joda Time fields.
|
||||||
* @author Keith Donald
|
* @author Keith Donald
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ import org.springframework.format.annotation.ISODateTimeFormat.ISO;
|
||||||
public final class ISODateTimeFormatAnnotationFormatterFactory extends AbstractDateTimeAnnotationFormatterFactory<ISODateTimeFormat> {
|
public final class ISODateTimeFormatAnnotationFormatterFactory extends AbstractDateTimeAnnotationFormatterFactory<ISODateTimeFormat> {
|
||||||
|
|
||||||
protected DateTimeFormatter configureDateTimeFormatterFrom(ISODateTimeFormat annotation) {
|
protected DateTimeFormatter configureDateTimeFormatterFrom(ISODateTimeFormat annotation) {
|
||||||
ISO style = annotation.value();
|
ISO format = annotation.value();
|
||||||
if (style == ISO.DATE) {
|
if (format == ISO.DATE) {
|
||||||
return org.joda.time.format.ISODateTimeFormat.date();
|
return org.joda.time.format.ISODateTimeFormat.date();
|
||||||
} else if (style == ISO.TIME) {
|
} else if (format == ISO.TIME) {
|
||||||
return org.joda.time.format.ISODateTimeFormat.time();
|
return org.joda.time.format.ISODateTimeFormat.time();
|
||||||
} else {
|
} else {
|
||||||
return org.joda.time.format.ISODateTimeFormat.dateTime();
|
return org.joda.time.format.ISODateTimeFormat.dateTime();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue