Annotation Type Component


  • @Documented
    @Retention(RUNTIME)
    @Target(TYPE)
    public @interface Component
    Defines a component implementation. A hint can be specified to differentiate this implementation from another one.
    Since:
    1.8.1
    Version:
    $Id: d29206c04ea407236274e96b2e06cdf54455ee16 $
    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      String[] hints
      Sometimes you want to register the component several times with different hints.
      Class<?>[] roles
      When specified forces the component to be registered as many times as there are roles specified.
      boolean staticRegistration  
      String value
      Deprecated.
      since 3.1M1 use the @Named annotation instead
    • Element Detail

      • value

        @Deprecated
        String value
        Deprecated.
        since 3.1M1 use the @Named annotation instead
        Returns:
        the hint value. Can be any text value. It's used to differentiate one component implementation from another one.
        Default:
        ""
      • hints

        String[] hints
        Sometimes you want to register the component several times with different hints. In this case the default annotation value is ignored and the passed list of hints is used instead.
        Returns:
        the list of hints
        Default:
        {}
      • roles

        Class<?>[] roles
        When specified forces the component to be registered as many times as there are roles specified. Otherwise the superclass/interface hierarchy is scanned for ComponentRole annotations and the component is registered under all roles found.
        Returns:
        the list of roles
        Default:
        {}
      • staticRegistration

        boolean staticRegistration
        Returns:
        true if the Component should be registered in a components.txt file. False can be used for example when using a component in a test and registering it dynamically without going through a components.txt file.
        Default:
        true