JAVA-2419: Move/rename module spring-boot-xml

This commit is contained in:
sampadawagde
2021-05-19 22:59:16 +05:30
parent bdd7733443
commit 56d69f922b
11 changed files with 7 additions and 45 deletions
@@ -0,0 +1,17 @@
package com.baeldung.springbootxml;
public class Pojo {
private String field;
public Pojo() {
}
public String getField() {
return field;
}
public void setField(String field) {
this.field = field;
}
}
@@ -0,0 +1,29 @@
package com.baeldung.springbootxml;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
@Configuration
@EnableAutoConfiguration
@ImportResource("classpath:beans.xml")
public class SpringBootXmlApplication implements CommandLineRunner {
private static final Logger logger = LoggerFactory.getLogger(SpringBootXmlApplication.class);
@Autowired private Pojo pojo;
public static void main(String[] args) {
SpringApplication.run(SpringBootXmlApplication.class, args);
}
public void run(String... args) {
logger.info(pojo.getField());
}
}