Bean Jsonitemreader, xml configuration

Asked

Viewed 18 times

0

My Reader will read a json that comes from a Rest api.

The project is configured in xml, IE, the settings are in an xml file, where are the other Beans.

I found in the documentation, a bean that reads this json and converts it into an object. The problem is that the settings I found are in Java, which is this code below:

@Bean
public JsonItemReader<Trade> jsonItemReader() {
   return new JsonItemReaderBuilder<Trade>()
                 .jsonObjectReader(new JacksonJsonObjectReader<>(Trade.class))
                 .resource(new ClassPathResource("trades.json"))
                 .name("tradeJsonItemReader")
                 .build();
}

How do I turn this into an xml configuration?

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.