Skip to content

Commit 3f02b4e

Browse files
committed
Improve documentation
1 parent da54300 commit 3f02b4e

File tree

1 file changed

+22
-12
lines changed

1 file changed

+22
-12
lines changed

configlib-core/src/main/java/de/exlll/configlib/PostProcess.java

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,33 @@
77

88
/**
99
* Indicates that the annotated element should be post-processed. This
10-
* annotation can be applied to fields and methods.
10+
* annotation can be applied to configuration elements and methods.
1111
* <p>
12-
* Applying this annotation to a field of a configuration class does not cause
13-
* any post-processing to be triggered automatically. However, both, the
14-
* presence of this annotation and the return value of its {@link #key()}
15-
* method can be used as a filter criterion when adding post-processors via a
16-
* {@code ConfigurationProperties} object.
12+
* Applying this annotation to configuration elements allows filtering these
13+
* elements easily via {@code ConfigurationElementFilter.byPostProcessKey}.
14+
* There mere presence of this annotation on a configuration element, however,
15+
* does not cause any post-processing to be triggered automatically.
1716
* <p>
18-
* When applied to a (non-static) method of a configuration type, the method is
19-
* called immediately after a configuration instance of that type has been
20-
* initialized. If the return type of the annotated method equals the
21-
* configuration type, the instance is replaced by the return value of that
22-
* method call. If the return type is {@code void}, then the method is simply
23-
* called on the given instance.
17+
* Applying this annotation to some (non-static/abstract) method of a
18+
* configuration type, results in that method being called after a configuration
19+
* instance of that type has been initialized. If the return type of the
20+
* annotated method is 'void', then the method is simply called. If the return
21+
* type equals the configuration type, the instance is replaced by the return
22+
* value of that method call.
23+
*
24+
* @see ConfigurationElementFilter#byPostProcessKey(String)
25+
* @see ConfigurationProperties.Builder#addPostProcessor
2426
*/
2527
@Target({ElementType.FIELD, ElementType.METHOD, ElementType.RECORD_COMPONENT})
2628
@Retention(RetentionPolicy.RUNTIME)
2729
public @interface PostProcess {
30+
/**
31+
* Returns some key that can be used for filtering configuration elements.
32+
* <p>
33+
* Specifying a key if this annotation is used on a method currently has no
34+
* effect but may be changed in the future.
35+
*
36+
* @return some arbitrary (developer-chosen) value
37+
*/
2838
String key() default "";
2939
}

0 commit comments

Comments
 (0)