Moved sprindi examples
This commit is contained in:
parent
126b7f1fe5
commit
61152915b7
@ -1,32 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>baeldung</groupId>
|
||||
<artifactId>baeldung</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
<version>4.2.6.RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.8</source>
|
||||
<target>1.8</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
@ -1,14 +1,14 @@
|
||||
package com.baeldung.spring;
|
||||
package com.baeldung.constructordi;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import com.baeldung.spring.domain.Engine;
|
||||
import com.baeldung.spring.domain.Transmission;
|
||||
import com.baeldung.constructordi.domain.Engine;
|
||||
import com.baeldung.constructordi.domain.Transmission;
|
||||
|
||||
@Configuration
|
||||
@ComponentScan("com.baeldung.spring")
|
||||
@ComponentScan("com.baeldung.constructordi")
|
||||
public class Config {
|
||||
|
||||
@Bean
|
@ -1,10 +1,11 @@
|
||||
package com.baeldung.spring;
|
||||
package com.baeldung.constructordi;
|
||||
|
||||
import com.baeldung.spring.domain.Car;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
|
||||
import org.springframework.context.support.ClassPathXmlApplicationContext;
|
||||
|
||||
import com.baeldung.constructordi.domain.Car;
|
||||
|
||||
public class SpringRunner {
|
||||
public static void main(String[] args) {
|
||||
Car toyota = getCarFromXml();
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.spring.domain;
|
||||
package com.baeldung.constructordi.domain;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.spring.domain;
|
||||
package com.baeldung.constructordi.domain;
|
||||
|
||||
public class Engine {
|
||||
private String type;
|
@ -1,4 +1,4 @@
|
||||
package com.baeldung.spring.domain;
|
||||
package com.baeldung.constructordi.domain;
|
||||
|
||||
public class Transmission {
|
||||
private String type;
|
@ -3,17 +3,17 @@
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans
|
||||
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
|
||||
|
||||
<bean id="toyota" class="com.baeldung.spring.domain.Car">
|
||||
<bean id="toyota" class="com.baeldung.constructordi.domain.Car">
|
||||
<constructor-arg index="0" ref="engine"/>
|
||||
<constructor-arg index="1" ref="transmission"/>
|
||||
</bean>
|
||||
|
||||
<bean id="engine" class="com.baeldung.spring.domain.Engine">
|
||||
<bean id="engine" class="com.baeldung.constructordi.domain.Engine">
|
||||
<constructor-arg index="0" value="v4"/>
|
||||
<constructor-arg index="1" value="2"/>
|
||||
</bean>
|
||||
|
||||
<bean id="transmission" class="com.baeldung.spring.domain.Transmission">
|
||||
<bean id="transmission" class="com.baeldung.constructordi.domain.Transmission">
|
||||
<constructor-arg value="sliding"/>
|
||||
</bean>
|
||||
|
Loading…
x
Reference in New Issue
Block a user