org.springframework.stereotype

Annotation Type Component



  • @Target(value=TYPE)
     @Retention(value=RUNTIME)
     @Documented
     @Indexed
    public @interface Component
    Indicates that an annotated class is a "component". Such classes are considered as candidates for auto-detection when using annotation-based configuration and classpath scanning.

    Other class-level annotations may be considered as identifying a component as well, typically a special kind of component: e.g. the @Repository annotation or AspectJ's @Aspect annotation.

    Since:
    2.5
    Author:
    Mark Fisher
    See Also:
    Repository, Service, Controller, ClassPathBeanDefinitionScanner
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element and Description
      java.lang.String value
      The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.
    • Element Detail

      • value

        public abstract java.lang.String value
        The value may indicate a suggestion for a logical component name, to be turned into a Spring bean in case of an autodetected component.
        Returns:
        the suggested component name, if any (or empty String otherwise)
        Default:
        ""