1 package be
.nikiroo
.utils
.resources
;
3 import java
.lang
.annotation
.ElementType
;
4 import java
.lang
.annotation
.Retention
;
5 import java
.lang
.annotation
.RetentionPolicy
;
6 import java
.lang
.annotation
.Target
;
9 * Annotation used to give some information about the translation keys, so the
10 * translation .properties file can be created programmatically.
14 @Retention(RetentionPolicy
.RUNTIME
)
15 @Target(ElementType
.FIELD
)
16 public @interface Meta
{
18 * The format of an item (the values it is expected to be of).
20 * Note that the INI file can contain arbitrary data, but it is expected to
26 /** An integer value, can be negative. */
30 /** Any text String. */
32 /** A password field. */
34 /** A colour (either by name or #rrggbb or #aarrggbb). */
36 /** A locale code (e.g., fr-BE, en-GB, es...). */
38 /** A path to a file. */
40 /** A path to a directory. */
42 /** A fixed list of values (see {@link Meta#list()} for the values). */
45 * A fixed list of values (see {@link Meta#list()} for the values) OR a
46 * custom String value (basically, a {@link Format#FIXED_LIST} with an
47 * option to enter a not accounted for value).
53 * A description of this item (what it is or does, how to explain that item
58 String
description() default "";
61 * This item is only used as a group, not as an option.
63 * For instance, you could have LANGUAGE_CODE as a group for which you won't
64 * use the value in the program, and LANGUAGE_CODE_FR, LANGUAGE_CODE_EN
65 * inside for which the value must be set.
67 * @return TRUE if it is a group
69 boolean group() default false;
72 * What format should/must this key be in.
74 * @return the format it is in
76 Format
format() default Format
.STRING
;
79 * The list of fixed values this item can be (either for
80 * {@link Format#FIXED_LIST} or {@link Format#COMBO_LIST}).
82 * @return the list of values
84 String
[] list() default {};
87 * This item can be left unspecified.
89 * @return TRUE if it can
91 boolean nullable() default true;
94 * The default value of this item.
98 String
def() default "";
101 * This item is a comma-separated list of values instead of a single value.
103 * The list items are separated by a comma, each surrounded by
104 * double-quotes, with backslashes and double-quotes escaped by a backslash.
106 * Example: <tt>"un", "deux"</tt>
108 * @return TRUE if it is
110 boolean array() default false;
113 * An addition to the format.
115 * Free info text to help translate, for instance the parameters order and
116 * type for String translations (i.e., %s = input file name, %d = file size
121 String
info() default "";