Annotation Interface PostInject
Marks a method to be invoked after configuration field injection has completed.
Methods annotated with @PostInject are called after all @Key annotated
fields have been populated from the configuration file. Useful for validation, computing
derived properties, or other post-loading initialization.
Examples:
@PostInject
private void updateDerivedProperties() {
this.serverUrl = "http://" + host + ":" + port;
}
@PostInject
private void validateConfiguration() {
if (port < 1 || port > 65535) {
throw new IllegalArgumentException("Port must be between 1 and 65535");
}
}
Requirements: Methods must take no parameters. Multiple methods per class are allowed. Execution order is not guaranteed.