Property Injection

You can add @Autowired for setters as well. This will trigger the so-called Config Method mechanism. Spring will call the method when the dependencies are available after the constructor has been called.


A property usually means that you have a field that follows the Java Bean Standard. For example, a property of type String named foo will have setFoo(String …) and String getFoo() methods. There are also read-only and write-only properties, where one of these is missing. boolean fields have a Getter starting with is, so isFoo() would be the correct name in this case.