@Target({METHOD,FIELD,PARAMETER}) @Retention(RUNTIME) @InjectAnnotation public @interface I18N
Injects I18n text into a field, based on the underlying resource in case of resource adaptation, or request. Note: not supported by the javax.Inject annotation because of performance reasons. Only direct annotation is supported.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Forces retrieving the i18n from the underlying resource, even if a request is being adapted.
    org.apache.sling.models.annotations.injectorspecific.InjectionStrategy
    if set to REQUIRED injection is mandatory, if set to OPTIONAL injection is optional, in case of DEFAULT the standard annotations (Optional, Required) are used.
    boolean
    if true only the path is used to determine the language.
    Represents the i18nKey
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Source value used for this annotation.
  • Field Details

  • Element Details

    • localeIgnoreContent

      boolean localeIgnoreContent
      if true only the path is used to determine the language.
      See Also:
      • Page.getLanguage(boolean)
      Default:
      false
    • forceRetrievalFromUnderlyingResource

      boolean forceRetrievalFromUnderlyingResource
      Forces retrieving the i18n from the underlying resource, even if a request is being adapted.
      Returns:
      Default:
      false
    • value

      String value
      Represents the i18nKey
      Returns:
      Default:
      ""
    • injectionStrategy

      org.apache.sling.models.annotations.injectorspecific.InjectionStrategy injectionStrategy
      if set to REQUIRED injection is mandatory, if set to OPTIONAL injection is optional, in case of DEFAULT the standard annotations (Optional, Required) are used. If even those are not available the default injection strategy defined on the Model applies. Default value = DEFAULT.
      Default:
      DEFAULT