Polishing

This commit is contained in:
Juergen Hoeller
2015-05-20 15:35:11 +02:00
parent de893ada2b
commit 271804f105
3 changed files with 17 additions and 17 deletions

View File

@@ -82,23 +82,23 @@ public @interface DateTimeFormat {
/**
* Common ISO date time format patterns.
*/
public enum ISO {
enum ISO {
/**
* The most common ISO Date Format {@code yyyy-MM-dd},
* e.g. 2000-10-31.
* e.g. "2000-10-31".
*/
DATE,
/**
* The most common ISO Time Format {@code HH:mm:ss.SSSZ},
* e.g. 01:30:00.000-05:00.
* e.g. "01:30:00.000-05:00".
*/
TIME,
/**
* The most common ISO DateTime Format {@code yyyy-MM-dd'T'HH:mm:ss.SSSZ},
* e.g. 2000-10-31 01:30:00.000-05:00.
* e.g. "2000-10-31 01:30:00.000-05:00".
* <p>This is the default if no annotation value is specified.
*/
DATE_TIME,

View File

@@ -70,11 +70,11 @@ public @interface NumberFormat {
/**
* Common number format styles.
*/
public enum Style {
enum Style {
/**
* The default format for the annotated type: typically number
* but possibly currency for a money type.
* The default format for the annotated type: typically 'number' but possibly
* 'currency' for a money type (e.g. {@code javax.money.MonetaryAmount)}.
* @since 4.2
*/
DEFAULT,
@@ -84,15 +84,15 @@ public @interface NumberFormat {
*/
NUMBER,
/**
* The currency format for the current locale.
*/
CURRENCY,
/**
* The percent format for the current locale.
*/
PERCENT
PERCENT,
/**
* The currency format for the current locale.
*/
CURRENCY
}
}

View File

@@ -61,12 +61,12 @@ public class NumberFormatAnnotationFormatterFactory extends EmbeddedValueResolut
}
else {
Style style = annotation.style();
if (style == Style.PERCENT) {
return new PercentStyleFormatter();
}
else if (style == Style.CURRENCY) {
if (style == Style.CURRENCY) {
return new CurrencyStyleFormatter();
}
else if (style == Style.PERCENT) {
return new PercentStyleFormatter();
}
else {
return new NumberStyleFormatter();
}