< prev index next >

modules/javafx.fxml/src/main/java/javafx/fxml/FXML.java

Print this page
rev 10404 : 8178015: Clarify requirement for app modules to export/open packages to javafx modules
Reviewed-by:

*** 32,54 **** import java.lang.module.ModuleDescriptor; /** * Annotation that tags a field or method as accessible to markup. * If the object being annotated is in a named module then it must ! * be reflectively accessible to the {@code javafx.fxml} module. * An object is reflectively accessible if the module containing that ! * object opens (see {@code Module.isOpen}) the containing package to the * {@code javafx.fxml} module, either in its {@link ModuleDescriptor} ! * (e.g., in its module-info.class) or by calling {@code Module.addOpens}. * An object is also reflectively accessible if it is declared as a public * member, is in a public class, and the module containing that class ! * exports (see {@code Module.isExported(String,Module)}) ! * the containing package to the {@code javafx.fxml} module. ! * If the object is not reflectively accessible to the {@code javafx.fxml} ! * module, then the {@link FXMLLoader} will fail with an ! * {@code InaccessibleObjectException} when it attempts to modify the ! * annotated element. * * @since JavaFX 2.0 */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD}) --- 32,62 ---- import java.lang.module.ModuleDescriptor; /** * Annotation that tags a field or method as accessible to markup. * If the object being annotated is in a named module then it must ! * be reflectively accessible by the {@code javafx.fxml} module. ! * Otherwise, the {@link FXMLLoader} will fail with an ! * {@code InaccessibleObjectException} when it attempts to modify the ! * annotated element. * An object is reflectively accessible if the module containing that ! * object {@link Module#isOpen(String,Module) opens} the containing package to ! * at least the * {@code javafx.fxml} module, either in its {@link ModuleDescriptor} ! * (e.g., in its module-info.class) or by calling {@link Module#addOpens}. * An object is also reflectively accessible if it is declared as a public * member, is in a public class, and the module containing that class ! * {@link Module#isExported(String,Module) exports} ! * the containing package to at least the {@code javafx.fxml} module. ! * <p> ! * For example, if an object that is annotated with {@code @FXML} ! * is in the {@code com.foo} package in the {@code foo.app} module, the ! * module-info.java might look like this: ! * </p> ! * <pre>{@code module foo.app { ! * opens com.foo to javafx.fxml; ! * }}</pre> * * @since JavaFX 2.0 */ @Retention(RetentionPolicy.RUNTIME) @Target({ElementType.FIELD, ElementType.METHOD})
< prev index next >