public class MeasurementAddonFactoryAdapter extends java.lang.Object implements MeasurementAddonFactory
Constructor and Description |
---|
MeasurementAddonFactoryAdapter()
Constructor.
|
MeasurementAddonFactoryAdapter(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass,
MeasurementInitializer<C> customInitializer,
ComponentMetadata<C> metadata)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<C extends MeasurementConfiguration> |
addAddon(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass,
MeasurementInitializer<C> customInitializer,
ComponentMetadata<C> metadata)
Adds an addon.
|
ComponentAddonUI<? extends MeasurementConfiguration> |
createMeasurementUI(java.lang.String typeIdentifier,
YouScopeClient client,
YouScopeServer server)
Returns a new measurement configuration addon for the given ID, or null if addon does not support the configuration of measurements witht the given ID.
|
ComponentMetadata<? extends MeasurementConfiguration> |
getComponentMetadata(java.lang.String typeIdentifier)
Returns the metadata (like human readable name) for a given measurement type.
|
java.lang.String[] |
getSupportedTypeIdentifiers()
Returns a list of all measurement configuration types supported by this addon
|
void |
initializeMeasurement(Measurement measurement,
MeasurementConfiguration configuration,
ConstructionContext constructionContext)
Called when this addon should initialize the the measurement according to its configuration.
|
boolean |
isSupportingTypeIdentifier(java.lang.String typeIdentifier)
Returns true if this addon supports measurement configurations with the given ID, false otherwise.
|
public MeasurementAddonFactoryAdapter(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass, MeasurementInitializer<C> customInitializer, ComponentMetadata<C> metadata)
configurationAddonClass
- The UI exposed to the user.customInitializer
- Object for measurement initialization.metadata
- Metadata about this addon.public MeasurementAddonFactoryAdapter()
addAddon()
to expose addons later on.public <C extends MeasurementConfiguration> void addAddon(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass, MeasurementInitializer<C> customInitializer, ComponentMetadata<C> metadata)
configurationAddonClass
- Class providing the UI elements.customInitializer
- A custom initializer for the measurement.metadata
- Metadata of the measurement.public java.lang.String[] getSupportedTypeIdentifiers()
MeasurementAddonFactory
getSupportedTypeIdentifiers
in interface MeasurementAddonFactory
public boolean isSupportingTypeIdentifier(java.lang.String typeIdentifier)
MeasurementAddonFactory
isSupportingTypeIdentifier
in interface MeasurementAddonFactory
typeIdentifier
- The ID of the measurement configuration for which it should be querried if this addon supports its construction.public ComponentAddonUI<? extends MeasurementConfiguration> createMeasurementUI(java.lang.String typeIdentifier, YouScopeClient client, YouScopeServer server) throws AddonException
MeasurementAddonFactory
createMeasurementUI
in interface MeasurementAddonFactory
typeIdentifier
- The type identifier of the measurement.client
- Interface to allow the addon to communicate with the client.server
- Interface to the server.AddonException
public ComponentMetadata<? extends MeasurementConfiguration> getComponentMetadata(java.lang.String typeIdentifier) throws AddonException
MeasurementAddonFactory
getComponentMetadata
in interface MeasurementAddonFactory
typeIdentifier
- The type identifier of the configuration for which the metadata should be returned.AddonException
- Thrown if identifier is not supported by the addon.public void initializeMeasurement(Measurement measurement, MeasurementConfiguration configuration, ConstructionContext constructionContext) throws ConfigurationException, AddonException
MeasurementAddonFactory
initializeMeasurement
in interface MeasurementAddonFactory
measurement
- The measurement which should be initialized.configuration
- The configuration according to which the measurement should be initialized.constructionContext
- An interface to an object allowing to initialize the various measurement components.ConfigurationException
- Thrown if the configuration is invalid.AddonException
- Thrown if an error occurred during the initialization.