Baeldung eclipse formatter added.
This commit is contained in:
parent
8c8af4e9bf
commit
b2dead9484
|
@ -16,10 +16,14 @@ public class ComputerAutowireFactory {
|
|||
// Get Spring bean "computer" created
|
||||
Computer computer = (Computer) context.getBean("computer");
|
||||
System.out.println("---------------- Constructor Injection via @Autowire------------------");
|
||||
System.out.println("Processor cores : " + computer.getProcessor().getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor().getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory().getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory().getFormat());
|
||||
System.out.println("Processor cores : " + computer.getProcessor()
|
||||
.getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor()
|
||||
.getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory()
|
||||
.getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory()
|
||||
.getFormat());
|
||||
System.out.println("---------------- Constructor Injection via @Autowire------------------");
|
||||
// Close Spring Application Context
|
||||
((ConfigurableApplicationContext) context).close();
|
||||
|
|
|
@ -16,10 +16,14 @@ public class ComputerBeanFactory {
|
|||
// Get Spring bean "computer" created
|
||||
Computer computer = (Computer) context.getBean("computer");
|
||||
System.out.println("---------------- Constructor Injection via @Bean ------------------");
|
||||
System.out.println("Processor cores : " + computer.getProcessor().getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor().getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory().getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory().getFormat());
|
||||
System.out.println("Processor cores : " + computer.getProcessor()
|
||||
.getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor()
|
||||
.getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory()
|
||||
.getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory()
|
||||
.getFormat());
|
||||
System.out.println("---------------- Constructor Injection via @Bean ------------------");
|
||||
|
||||
// Close Spring Application Context
|
||||
|
|
|
@ -6,8 +6,6 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|||
|
||||
import com.baeldung.di.constructor.model.xml.Computer;
|
||||
|
||||
|
||||
|
||||
public class ComputerXmlFactory {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -17,10 +15,14 @@ public class ComputerXmlFactory {
|
|||
// Get Spring bean "computer" created
|
||||
Computer computer = (Computer) context.getBean("computer");
|
||||
System.out.println("---------------- Constructor Injection via XML ------------------");
|
||||
System.out.println("Processor cores : " + computer.getProcessor().getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor().getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory().getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory().getFormat());
|
||||
System.out.println("Processor cores : " + computer.getProcessor()
|
||||
.getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor()
|
||||
.getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory()
|
||||
.getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory()
|
||||
.getFormat());
|
||||
System.out.println("---------------- Constructor Injection via XML ------------------");
|
||||
|
||||
// Close Spring Application Context
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
|||
import com.baeldung.di.setter.config.SpringAutowireSetterContext;
|
||||
import com.baeldung.di.setter.model.autowire.Computer;
|
||||
|
||||
|
||||
public class ComputerAutowireFactory {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -17,10 +16,14 @@ public class ComputerAutowireFactory {
|
|||
// Get Spring bean "computer" created
|
||||
Computer computer = (Computer) context.getBean("computer");
|
||||
System.out.println("---------------- Setter Injection via @Autowire ------------------");
|
||||
System.out.println("Processor cores : " + computer.getProcessor().getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor().getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory().getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory().getFormat());
|
||||
System.out.println("Processor cores : " + computer.getProcessor()
|
||||
.getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor()
|
||||
.getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory()
|
||||
.getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory()
|
||||
.getFormat());
|
||||
System.out.println("---------------- Setter Injection via @Autowire ------------------");
|
||||
// Close Spring Application Context
|
||||
((ConfigurableApplicationContext) context).close();
|
||||
|
|
|
@ -7,7 +7,6 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
|||
import com.baeldung.di.setter.config.SpringBeanSetterContext;
|
||||
import com.baeldung.di.setter.model.bean.Computer;
|
||||
|
||||
|
||||
public class ComputerBeanFactory {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -17,10 +16,14 @@ public class ComputerBeanFactory {
|
|||
// Get Spring bean "computer" created
|
||||
Computer computer = (Computer) context.getBean("computer");
|
||||
System.out.println("---------------- Setter Injection via @Bean ------------------");
|
||||
System.out.println("Processor cores : " + computer.getProcessor().getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor().getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory().getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory().getFormat());
|
||||
System.out.println("Processor cores : " + computer.getProcessor()
|
||||
.getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor()
|
||||
.getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory()
|
||||
.getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory()
|
||||
.getFormat());
|
||||
System.out.println("---------------- Setter Injection via @Bean ------------------");
|
||||
|
||||
// Close Spring Application Context
|
||||
|
|
|
@ -6,8 +6,6 @@ import org.springframework.context.support.ClassPathXmlApplicationContext;
|
|||
|
||||
import com.baeldung.di.setter.model.xml.Computer;
|
||||
|
||||
|
||||
|
||||
public class ComputerXmlFactory {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
@ -17,10 +15,14 @@ public class ComputerXmlFactory {
|
|||
// Get Spring bean "computer" created
|
||||
Computer computer = (Computer) context.getBean("computer");
|
||||
System.out.println("---------------- Setter Injection via XML ------------------");
|
||||
System.out.println("Processor cores : " + computer.getProcessor().getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor().getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory().getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory().getFormat());
|
||||
System.out.println("Processor cores : " + computer.getProcessor()
|
||||
.getCores());
|
||||
System.out.println("Processor frequency : " + computer.getProcessor()
|
||||
.getFrequency());
|
||||
System.out.println("Memory Size in GB : " + computer.getMemory()
|
||||
.getSizeInGb());
|
||||
System.out.println("Memory format : " + computer.getMemory()
|
||||
.getFormat());
|
||||
System.out.println("---------------- Setter Injection via XML ------------------");
|
||||
// Close Spring Application Context
|
||||
((ConfigurableApplicationContext) context).close();
|
||||
|
|
|
@ -5,6 +5,7 @@ public class Memory {
|
|||
private Integer sizeInGb = 16;
|
||||
private String format = "DDR3";
|
||||
|
||||
//
|
||||
public Integer getSizeInGb() {
|
||||
return sizeInGb;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue