Is it possible to use @Valid annotation in console Spring-based application?
===

I have `AnnotationConfigApplicationContext` created with `@Configuration` annotated class as a param:

    @Configuration
    class Config {

        @Bean
        public LocalValidatorFactoryBean localValidatorFactoryBean() {
            return new LocalValidatorFactoryBean();
        }

        @Bean
        public A aBean() {
            return new A();
        }

        @Bean
        public B aBean() {
            return new B();
        }
    }

Where `A` and `B` are:

    class A {

        @Min(1)
        public int myInt;
    }

    class B {

        @Autowire(required = true)
        @Valid
        public A aBean;
    }

**Q:** Is it possible to make Spring to process `@Valid` annotation in this case?


**PS:** Currently I have following working implementation of `B`:

    class B {

        public A aBean;

        public void setABean(A aBean, Validator validator) {
            if (validator.validate(aBean).size() > 0) {
                throw new ValidationException();
            }
            this.aBean = aBean;
        }
    }

This impl seems a bit clumsy to me and I want to replace it. Please help :)