Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Right way of using Governator's @Configuration annotation
public class MyClass {
@Configuration("path.prefix")
private String pathPrefix;
private String fileName;
public MyClass(String fileName) {
this.fileName = fileName; //here we simply store it
}
@PostConstruct
void initialize() {
fileName = pathPrefix + fileName; //and here we use the configuration setting and create the full path
}
//... rest of the work goes here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment