@Retention(value=RUNTIME) @Target(value=FIELD) public @interface InjectResourceBundle
ResourceBundle into your ViewModel
and/or FxmlView/JavaView.
The annotation has to be set on a field of type ResourceBundle.
For fxml based views there are three options to get the ResourceBundle:
Initializable provided by the JavaFX runtime.IllegalStateException will be thrown.IllegalStateException will be thrown.optional() is set to
true (default value is false) and no ResourceBundle is provided when the view is
loaded, no exception will be thrown and no ResourceBundle will be injected. You have to check for
null in this case.| Modifier and Type | Optional Element and Description |
|---|---|
boolean |
optional
Default value:
false. |
public abstract boolean optional
false.
You can use this attribute to express that the resourceBundle injection is optional. If this attribute is set to
true and there is a ResourceBundle available it will be injected as normal. If this attribute is set
to true but no ResourceBundle is available, nothing will be injection and no
IllegalStateException will be thrown to warn you.Copyright © 2015 Saxonia Systems AG. All rights reserved.