com.opensymphony.xwork2.inject

## Annotation Type Inject

-     @Target(value={METHOD,CONSTRUCTOR,FIELD,PARAMETER})
       @Retention(value=RUNTIME)
      public @interface Inject

  Annotates members and parameters which should have their value[s] injected.

  Author:
    crazybob@google.com (Bob Lee)

- - ### Optional Element Summary

    Optional Elements
    Modifier and Type | Optional Element and Description
    --- | ---
    `boolean` | `required`
    `String` | `value`

- - ### Element Detail

    - #### value

          public abstract String value

      Returns:
        Dependency name. Defaults to `Container.DEFAULT_NAME`.
      Default:
        "default"

  - - #### required

          public abstract boolean required

      Returns:
        Whether or not injection is required. Applicable only to methods and fields (not constructors or parameters).
      Default:
        true

Copyright © 2000–2026 Apache Software Foundation. All rights reserved.