bael-4197: add main source
This commit is contained in:
parent
8fd0ab58b9
commit
63843c008c
|
@ -0,0 +1,15 @@
|
|||
package com.baeldung.xmlapplicationcontext;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ImportResource;
|
||||
|
||||
@SpringBootApplication
|
||||
@ImportResource({"classpath*:application-context.xml"})
|
||||
public class XmlBeanApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(XmlBeanApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.baeldung.xmlapplicationcontext.domain;
|
||||
|
||||
public class Employee {
|
||||
|
||||
private String name;
|
||||
private String role;
|
||||
|
||||
public Employee() {
|
||||
|
||||
}
|
||||
|
||||
public Employee(String name, String role) {
|
||||
this.name = name;
|
||||
this.role = role;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public String getRole() {
|
||||
return this.role;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setRole(String role) {
|
||||
this.role = role;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.baeldung.xmlapplicationcontext.service;
|
||||
|
||||
import com.baeldung.xmlapplicationcontext.domain.Employee;
|
||||
|
||||
public interface EmployeeService {
|
||||
|
||||
Employee getEmployee();
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.baeldung.xmlapplicationcontext.service;
|
||||
|
||||
import com.baeldung.xmlapplicationcontext.domain.Employee;
|
||||
|
||||
public class EmployeeServiceImpl implements EmployeeService {
|
||||
|
||||
@Override
|
||||
public Employee getEmployee() {
|
||||
return new Employee("Baeldung", "Admin");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.baeldung.xmlapplicationcontext.service;
|
||||
|
||||
import com.baeldung.xmlapplicationcontext.domain.Employee;
|
||||
|
||||
public class EmployeeServiceTestImpl implements EmployeeService {
|
||||
|
||||
@Override
|
||||
public Employee getEmployee() {
|
||||
return new Employee("Baeldung-Test", "Admin");
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue