BAEL 148 move to this repo (#2885)
This commit is contained in:
committed by
Zeger Hendrikse
parent
303db6c663
commit
fb283f35c7
@@ -0,0 +1,17 @@
|
||||
package com.baeldug.groovyconfig;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class BandsBean {
|
||||
|
||||
private List<String> bandsList = new ArrayList<>();
|
||||
|
||||
public List<String> getBandsList() {
|
||||
return bandsList;
|
||||
}
|
||||
|
||||
public void setBandsList(List<String> bandsList) {
|
||||
this.bandsList = bandsList;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.baeldug.groovyconfig;
|
||||
|
||||
beans {
|
||||
javaPesronBean(JavaPersonBean) {
|
||||
firstName = 'John'
|
||||
lastName = 'Doe'
|
||||
age ='32'
|
||||
eyesColor = 'blue'
|
||||
hairColor='black'
|
||||
}
|
||||
|
||||
bandsBean(BandsBean) { bean->
|
||||
bean.scope = "singleton"
|
||||
bandsList=['Nirvana', 'Pearl Jam', 'Foo Fighters']
|
||||
}
|
||||
|
||||
registerAlias("bandsBean","bands")
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.baeldug.groovyconfig;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class JavaBeanConfig {
|
||||
|
||||
@Bean
|
||||
public JavaPersonBean javaPerson() {
|
||||
JavaPersonBean jPerson = new JavaPersonBean();
|
||||
jPerson.setFirstName("John");
|
||||
jPerson.setLastName("Doe");
|
||||
jPerson.setAge("31");
|
||||
jPerson.setEyesColor("green");
|
||||
jPerson.setHairColor("blond");
|
||||
|
||||
return jPerson;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
package com.baeldug.groovyconfig;
|
||||
|
||||
public class JavaPersonBean {
|
||||
|
||||
public String jj;
|
||||
|
||||
private String firstName;
|
||||
|
||||
private String lastName;
|
||||
|
||||
private String age;
|
||||
|
||||
private String eyesColor;
|
||||
|
||||
private String hairColor;
|
||||
|
||||
public String getFirstName() {
|
||||
return firstName;
|
||||
}
|
||||
|
||||
public void setFirstName(String firstName) {
|
||||
this.firstName = firstName;
|
||||
}
|
||||
|
||||
public String getLastName() {
|
||||
return lastName;
|
||||
}
|
||||
|
||||
public void setLastName(String lastName) {
|
||||
this.lastName = lastName;
|
||||
}
|
||||
|
||||
public String getAge() {
|
||||
return age;
|
||||
}
|
||||
|
||||
public void setAge(String age) {
|
||||
this.age = age;
|
||||
}
|
||||
|
||||
public String getEyesColor() {
|
||||
return eyesColor;
|
||||
}
|
||||
|
||||
public void setEyesColor(String eyesColor) {
|
||||
this.eyesColor = eyesColor;
|
||||
}
|
||||
|
||||
public String getHairColor() {
|
||||
return hairColor;
|
||||
}
|
||||
|
||||
public void setHairColor(String hairColor) {
|
||||
this.hairColor = hairColor;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<beans xmlns="http://www.springframework.org/schema/beans"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
<bean id="JavaPersonBean" class="com.baeldug.groovyconfig.JavaPersonBean">
|
||||
<property name="firstName" value="John" />
|
||||
<property name="LastName" value="Doe" />
|
||||
<property name="age" value="30" />
|
||||
<property name="eyesColor" value="brown" />
|
||||
<property name="hairColor" value="brown" />
|
||||
</bean>
|
||||
</beans>
|
||||
Reference in New Issue
Block a user