java.module.annotation
Annotation Type Optional


@Retention(value=RUNTIME)
public @interface Optional

Indicates an import in a module definition is optional at runtime. This metadata annotation is applied to the import of the development module, i.e. the superpackage construct.

For example,

    superpackage com.wombat.xyz {
       //
       // Imports org.opensource.library version 2.0 if it exists when this module is initialized.
       //
       @Optional
       @VersionConstraint("2.0")
       import org.opensource.library;
       ...
    }
 

Since:
1.7.0
Author:
Stanley M. Ho