// Path: springbootDemo2/src/main/java/me/helllp/demo/test/MyCondition.java
// public class MyCondition implements Condition{
//     /** 
//      * 如果是windows系统，返回true；否则返回false 
//      */  
//     public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata){  
//         return context.getEnvironment().getProperty("os.name").contains("Windows");  
//     }  
// }


import me.helllp.demo.test.MyCondition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

package me.helllp.demo.springbootDemo2;



@Configuration  
public class Config  
{  
	/**
	 * 如果MyCondition中match返回ture则可以注入Bean；否则不能注入
	 * 
	 * @return
	 */
    @Bean

// Path: springbootDemo2/src/main/java/me/helllp/demo/test/MyCondition.java
// public class MyCondition implements Condition{
//     /** 
//      * 如果是windows系统，返回true；否则返回false 
//      */  
//     public boolean matches(ConditionContext context, AnnotatedTypeMetadata metadata){  
//         return context.getEnvironment().getProperty("os.name").contains("Windows");  
//     }  
// }


// Path: springbootDemo2/src/main/java/me/helllp/demo/springbootDemo2/Config.java
import me.helllp.demo.test.MyCondition;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

package me.helllp.demo.springbootDemo2;



@Configuration  
public class Config  
{  
	/**
	 * 如果MyCondition中match返回ture则可以注入Bean；否则不能注入
	 * 
	 * @return
	 */
    @Bean

    @Conditional(MyCondition.class)
