Class ExtensionPoint<T extends PluginFeature>
- All Implemented Interfaces:
Identified
An ExtensionPoint is an official advertised place that allows a Plugin
to advertise a PluginFeature
SPI and a place where implementing features should be registered by the plugin system during startup.
ExtensionPoints are advertised by adding them to the list returned by Plugin.getExtensionPoints()
TODO we might want to introduce some kind of bootstrapping thing? But that might in itself be a Feature. Going to leave that out for now and see what we neeed.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addFeature
(T feature) Add a feature to the listboolean
addFeatureIf
(PluginFeature feature) Add a feature of unknown type to the list<U extends PluginFeature>
Optional<ExtensionPoint<U>>checkFeatureClass
(Class<U> ofClass) The 'service provider interface' class for this extension.getId()
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface nz.org.riskscape.engine.Identified
getIdentifiedClass
-
Constructor Details
-
ExtensionPoint
-
-
Method Details
-
getId
- Specified by:
getId
in interfaceIdentified
- Returns:
- id
-
addFeature
Add a feature to the list
-
addFeatureIf
Add a feature of unknown type to the list
- Returns:
- true if it was added (and the right type)
-
getFeatures
- Returns:
- an immutable list of collected features for this extension point
-
checkFeatureClass
- Returns:
- this ExtensionPoint cast to the given feature class. Useful when working with a specific extension point and you need to get java's generic types to shut up and leave you alone.
-
toString
-
getFeatureClass
The 'service provider interface' class for this extension. Any features that belong to this extension point are instances of this class.
Note that this doesn't actually have to be an interface, but it's standard nomenclature for this sort of thing.
-