In our application we are trying to read a flat property file using Jackson to match the properties to our POJO Everything works fine, but when the property name contains some dot, the wholo POJO is set to null
Here is a sample of the property file
p.test=Just a test
Here is my POJO
public class BasicPOJO {
@JsonProperty("p.test")
private String test;
public String getTest() {
return test;
}
public void setTest(String test) {
this.test = test;
}
}
And here is how I map it
InputStream in = ApplicationProperties.class.getClassLoader()
.getResourceAsStream("application.properties");
JavaPropsMapper mapper = new JavaPropsMapper();
try {
BasicPOJO myProperties = mapper.readValue(in,
BasicPOJO .class);
LOGGER.debug("Loaded properties {}", myProperties); //myProperties.test is null here
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
Any help will be appreciated