Can you use @Autowired with static fields?
@Component("NewClass")
public class NewClass{
private static SomeThing someThing;
@Autowired
public void setSomeThing(SomeThing someThing){
NewClass.someThing = someThing;
}
}
In short, no. You cannot autowire or manually wire static fields in Spring. You'll have to write your own logic to do this.
@Autowired
can be used with setters so you could have a setter modifying an static field.
Just one final suggestion... DON'T