java/Spring Inject a property value in pojo (non-managed) -


i have pojo class in fields annotated custom annotation. non-spring managed class.

public class reportheader {      @field(position = 1)     private string jobname;      .... } 

now want pass value of "position" attribute in annotation through property file, below:

public class reportheader {      @field(position = "${read.my.position}")     private string jobname;      .... } 

how can in pojo class or without spring?

if it's not managed spring, cannot expect inject anything. it's either/or proposition.

you can have spring manage .properties , give reportheader constructor set state using properties object that's passed in.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -