Class BundleSupport
java.lang.Object
org.tentackle.common.BundleSupport
Support to locate bundle services.
Annotations marking classes as bundles, such as @Bundle or @FxControllerService,
must be listed in META-INF/services/org.tentackle.common.BundleSupport of the module declaring
the annotation. This entry must be created manually in order to be processed by the BundleFactory
at runtime as well as by the tentackle-, check- and i18n-maven-plugins at build time.
For each such annotation, the analyze goal of the tentackle-maven-plugin writes the annotated classes to
META-INF/bundles/<annotation classname>, one entry per line, in the form
bundleNameor, if the bundle is registered under an additional key name (see
Bundle.value()),
keyName = bundleNameColons and spaces are accepted as separators as well.
- Author:
- harald
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe service name to find all annotations to mark classes as bundles.
Such as @Bundle or @FxControllerService. -
Constructor Summary
ConstructorsConstructorDescriptionBundleSupport(ModuleInfo info, String className, String bundleName) Creates a bundle support object. -
Method Summary
Modifier and TypeMethodDescriptionGets the bundle name.
This is the name of the annotated class.static List<BundleSupport> getBundles(ClassLoader classLoader) Finds all bundle services.Gets the key name the bundle is registered for.
This is the same as the bundle name, unless the bundle was registered under an additional key name (seeBundle.value()).Gets the module info.
-
Field Details
-
BUNDLE_SERVICE
The service name to find all annotations to mark classes as bundles.
Such as @Bundle or @FxControllerService.
-
-
Constructor Details
-
BundleSupport
Creates a bundle support object.- Parameters:
info- the optional jigsaw module info, null if noneclassName- the key name the bundle is registered for, usually the same as the bundle namebundleName- the name of the resource bundle, i.e., the name of the annotated class
-
-
Method Details
-
getBundles
Finds all bundle services.- Parameters:
classLoader- the classloader, null if default- Returns:
- the list of bundle supports
- Throws:
TentackleRuntimeException- if an entry is malformed
-
getModuleInfo
Gets the module info.- Returns:
- the optional module info, null if none
-
getClassName
Gets the key name the bundle is registered for.
This is the same as the bundle name, unless the bundle was registered under an additional key name (seeBundle.value()).- Returns:
- the key name
-
getBundleName
Gets the bundle name.
This is the name of the annotated class.- Returns:
- the bundle name
-