|
25 | 25 | /** |
26 | 26 | * Declares that a field or method parameter should be formatted as a number. |
27 | 27 | * |
28 | | - * <p>Supports formatting by style or custom pattern string. Can be applied |
29 | | - * to any JDK {@code Number} type such as {@code Double} and {@code Long}. |
| 28 | + * <p>Supports formatting by style or custom pattern string. Can be applied to |
| 29 | + * any JDK {@code Number} types such as {@code Double} and {@code Long}. |
30 | 30 | * |
31 | | - * <p>For style-based formatting, set the {@link #style} attribute to be the |
32 | | - * desired {@link Style}. For custom formatting, set the {@link #pattern} |
33 | | - * attribute to be the number pattern, such as {@code #, ###.##}. |
| 31 | + * <p>For style-based formatting, set the {@link #style} attribute to the desired |
| 32 | + * {@link Style}. For custom formatting, set the {@link #pattern} attribute to the |
| 33 | + * desired number pattern, such as {@code "#,###.##"}. |
34 | 34 | * |
35 | 35 | * <p>Each attribute is mutually exclusive, so only set one attribute per |
36 | | - * annotation instance (the one most convenient one for your formatting needs). |
37 | | - * When the {@link #pattern} attribute is specified, it takes precedence over |
38 | | - * the {@link #style} attribute. When no annotation attributes are specified, |
39 | | - * the default format applied is style-based for either number or currency, |
| 36 | + * annotation (the one most convenient for your formatting needs). When the |
| 37 | + * {@link #pattern} attribute is specified, it takes precedence over the |
| 38 | + * {@link #style} attribute. When no annotation attributes are specified, the |
| 39 | + * default format applied is style-based for either number or currency, |
40 | 40 | * depending on the annotated field or method parameter type. |
41 | 41 | * |
42 | 42 | * @author Keith Donald |
|
50 | 50 | public @interface NumberFormat { |
51 | 51 |
|
52 | 52 | /** |
53 | | - * The style pattern to use to format the field. |
| 53 | + * The style pattern to use to format the field or method parameter. |
54 | 54 | * <p>Defaults to {@link Style#DEFAULT} for general-purpose number formatting |
55 | 55 | * for most annotated types, except for money types which default to currency |
56 | | - * formatting. Set this attribute when you wish to format your field in |
57 | | - * accordance with a common style other than the default style. |
| 56 | + * formatting. |
| 57 | + * <p>Set this attribute when you wish to format your field or method parameter |
| 58 | + * in accordance with a common style other than the default style. |
58 | 59 | */ |
59 | 60 | Style style() default Style.DEFAULT; |
60 | 61 |
|
61 | 62 | /** |
62 | | - * The custom pattern to use to format the field. |
63 | | - * <p>Defaults to empty String, indicating no custom pattern String has been specified. |
64 | | - * Set this attribute when you wish to format your field in accordance with a |
65 | | - * custom number pattern not represented by a style. |
| 63 | + * The custom pattern to use to format the field or method parameter. |
| 64 | + * <p>Defaults to an empty String, indicating no custom pattern has been |
| 65 | + * specified. |
| 66 | + * <p>Set this attribute when you wish to format your field or method parameter |
| 67 | + * in accordance with a custom number pattern not represented by a style. |
66 | 68 | */ |
67 | 69 | String pattern() default ""; |
68 | 70 |
|
|
0 commit comments