Package io.avaje.inject
Annotation Type PostConstruct
-
@Documented @Retention(RUNTIME) @Target(METHOD) public @interface PostConstruct
ThePostConstructannotation is used on a method that needs to be executed after dependency injection is done to perform any initialization.Note that we can equally use any
PostConstructannotation - so we can use the one fromjavax.annotation,jakarta.annotationor this one.Only one method in a given class can be annotated with this annotation.
The method on which the
PostConstructannotation is applied must fulfill the following criteria:- The method must not have any parameters.
- The method may be public, protected or package private.
- The method must not be static.