lundi 20 août 2018

Is there a pattern to force the setting of a property in an injected component?

I am wondering if there is a pattern that forces the user of my component to set a property after it is autowired. For example i have this:

@SpringComponent
public class MyAutowiredClass {

    private String myVariabeThatTheUserShouldSet;

    public MyAutowiredClass(someOtherStuff ...(not my StringVariable)){

    }
}

In this example how to i force myVariabeThatTheUserShouldSet to be set from the user of this component?

Aucun commentaire:

Enregistrer un commentaire