Module com.github.rvesse.airline
Annotation Type AirlineModule
-
@Target(FIELD) @Retention(RUNTIME) @Documented public @interface AirlineModule
Used to mark a field of a command class as representing a module of command functionality. For fields marked with this annotation Airline will inspect their value type in order to find furtherOption
orArguments
annotations that may be present on its fields. This allows composing common functionality into commands without using inheritance. See Inheritance and Composition in the User Guide for more details.Historically Airline used the
@Inject
annotation for this purpose. However in recent years dependency injection has become much more widely used and@Inject
is the standard annotation for that, this often creates conflicts between Airline and the dependency injection frameworks. Therefore from 2.9.0 onwards we introduced this annotation as a replacement for it.For backwards compatibility users can continue to use the
@Inject
annotation for the time being BUT this will stop being the default behaviour in future releases and require manual configuration to achieve. SeeParser.compositionAnnotationClasses()
for how to configure this.