Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT

## org.springframework.context.annotation
Annotation Type Lazy

    @Target(value={TYPE,METHOD})
    @Retention(value=RUNTIME)
    @Inherited
    @Documented
    public @interface Lazy

Indicates whether a bean is to be lazily initialized.

May be used on any class directly or indirectly annotated with `Component` or on methods annotated with `Bean`.

If this annotation is not present on a Component or Bean definition, eager initialization will occur. If present and set to true, the Bean/Component will not be initialized until referenced by another bean or explicitly retrieved from the enclosing `BeanFactory`. If present and set to false, the bean will be instantiated on startup by bean factories that perform eager initialization of singletons.

If Lazy is present on a `Configuration` class, this indicates that all `Bean` methods within that Configuration should be lazily initialized. If Lazy is present and false on a Bean method within a Lazy-annotated Configuration class, this indicates overriding the 'default lazy' behavior and that the bean should be eagerly initialized.

Since:
  3.0
Author:
  Chris Beams
See Also:
  `Primary`, `Bean`, `Configuration`, `Component`

Optional Element Summary
`boolean` | `value` Whether lazy initialization should occur.

### value

    public abstract boolean value

  Whether lazy initialization should occur.

  Default:
    true

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT