public class ComponentAddonFactoryAdapter extends java.lang.Object implements ComponentAddonFactory
Constructor and Description |
---|
ComponentAddonFactoryAdapter()
Constructor.
|
ComponentAddonFactoryAdapter(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass,
java.lang.Class<? extends Component> componentClass,
ComponentMetadata<C> metadata)
Constructor.
|
ComponentAddonFactoryAdapter(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass,
CustomAddonCreator<C,?> customCreator,
ComponentMetadata<C> metadata)
Constructor.
|
ComponentAddonFactoryAdapter(java.lang.String typeIdentifier,
java.lang.Class<C> configurationClass,
java.lang.Class<? extends Component> componentClass)
Constructor.
|
ComponentAddonFactoryAdapter(java.lang.String typeIdentifier,
java.lang.Class<C> configurationClass,
CustomAddonCreator<C,?> customCreator)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
<C extends Configuration> |
addAddon(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass,
java.lang.Class<? extends Component> componentClass,
ComponentMetadata<C> metadata)
Adds an addon with an own UI, but automatic component creation by appropriate constructors of the component.
|
<C extends Configuration> |
addAddon(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass,
CustomAddonCreator<C,?> customCreator,
ComponentMetadata<C> metadata)
Adds an addon which does component creation on its own, as well as has an own UI.
|
<C extends Configuration> |
addAddon(java.lang.String typeIdentifier,
java.lang.Class<C> configurationClass,
java.lang.Class<? extends Component> componentClass)
Adds an addon with an automatically generated UI, as well as automatic component creation by appropriate constructors of the component.
|
<C extends Configuration> |
addAddon(java.lang.String typeIdentifier,
java.lang.Class<C> configurationClass,
CustomAddonCreator<C,?> customCreator)
Adds an addon which does component creation on its own, but has generic UI.
|
Component |
createComponent(PositionInformation positionInformation,
Configuration configuration,
ConstructionContext constructionContext)
Creates an addon for the given configuration.
|
ComponentAddonUI<?> |
createComponentUI(java.lang.String typeIdentifier,
YouScopeClient client,
YouScopeServer server)
Returns a new UI to configure a component of the given type identifier.
|
ComponentMetadata<?> |
getComponentMetadata(java.lang.String typeIdentifier)
Returns the metadata (like human readable name) for a given configuration type.
|
java.lang.String[] |
getSupportedTypeIdentifiers()
Returns a list of all component type identifiers supported by this factory.
|
boolean |
isSupportingTypeIdentifier(java.lang.String typeIdentifier)
Returns true if this factory supports configurations with the given ID, false otherwise.
|
public ComponentAddonFactoryAdapter(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass, java.lang.Class<? extends Component> componentClass, ComponentMetadata<C> metadata)
Foo(PositionInformation positionInformation)
Foo(PositionInformation positionInformation, C configuration)
Foo(PositionInformation positionInformation, C configuration, ConstructionContext initializer)
metadata.getConfigurationClass()
, respectively the generic constructor type.configurationAddonClass
- The UI exposed to the user.componentClass
- The component which can be created by the addon.metadata
- Metadata about this addon.public ComponentAddonFactoryAdapter(java.lang.String typeIdentifier, java.lang.Class<C> configurationClass, java.lang.Class<? extends Component> componentClass)
Foo(PositionInformation positionInformation)
Foo(PositionInformation positionInformation, C configuration)
Foo(PositionInformation positionInformation, C configuration, ConstructionContext initializer)
typeIdentifier
- Type identifier of addon.configurationClass
- Configuration class of addon. Used in automatic UI construction.componentClass
- The component which can be created by the addon.public ComponentAddonFactoryAdapter(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass, CustomAddonCreator<C,?> customCreator, ComponentMetadata<C> metadata)
configurationAddonClass
- The UI exposed to the user.customCreator
- A custom creator to initialize the component given the configuration.metadata
- Metadata about this addon.public ComponentAddonFactoryAdapter(java.lang.String typeIdentifier, java.lang.Class<C> configurationClass, CustomAddonCreator<C,?> customCreator)
typeIdentifier
- Type identifier of addon.configurationClass
- Configuration class of addon. Used in automatic UI construction.customCreator
- A custom creator to initialize the component given the configuration.public ComponentAddonFactoryAdapter()
addAddon()
to expose addons later on.public Component createComponent(PositionInformation positionInformation, Configuration configuration, ConstructionContext constructionContext) throws ConfigurationException, AddonException
ComponentAddonFactory
createComponent
in interface ComponentAddonFactory
positionInformation
- The position in the measurement hierarchy where the addon should be constructed.configuration
- The configuration of the addon.constructionContext
- The context of the construction, providing information and functionality in the construction of the addon.ConfigurationException
- Thrown if the configuration is invalid.AddonException
- Thrown if an error occurred during the construction.public <C extends Configuration> void addAddon(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass, CustomAddonCreator<C,?> customCreator, ComponentMetadata<C> metadata)
configurationAddonClass
- Class providing the UI elements.customCreator
- A custom creator to initialize the component given the configuration.metadata
- Metadata of the component.public <C extends Configuration> void addAddon(java.lang.Class<? extends ComponentAddonUI<C>> configurationAddonClass, java.lang.Class<? extends Component> componentClass, ComponentMetadata<C> metadata)
Foo(PositionInformation positionInformation)
Foo(PositionInformation positionInformation, C configuration)
Foo(PositionInformation positionInformation, C configuration, ConstructionContext initializer)
metadata.getConfigurationClass()
, respectively the generic constructor type.configurationAddonClass
- componentClass
- metadata
- public <C extends Configuration> void addAddon(java.lang.String typeIdentifier, java.lang.Class<C> configurationClass, java.lang.Class<? extends Component> componentClass)
Foo(PositionInformation positionInformation)
Foo(PositionInformation positionInformation, C configuration)
Foo(PositionInformation positionInformation, C configuration, ConstructionContext initializer)
typeIdentifier
- configurationClass
- componentClass
- public <C extends Configuration> void addAddon(java.lang.String typeIdentifier, java.lang.Class<C> configurationClass, CustomAddonCreator<C,?> customCreator)
typeIdentifier
- configurationClass
- customCreator
- public java.lang.String[] getSupportedTypeIdentifiers()
ComponentAddonFactory
getSupportedTypeIdentifiers
in interface ComponentAddonFactory
public boolean isSupportingTypeIdentifier(java.lang.String typeIdentifier)
ComponentAddonFactory
isSupportingTypeIdentifier
in interface ComponentAddonFactory
typeIdentifier
- The ID of the configuration for which it should be queried if this factory supports its construction.public ComponentAddonUI<?> createComponentUI(java.lang.String typeIdentifier, YouScopeClient client, YouScopeServer server) throws AddonException
ComponentAddonFactory
createComponentUI
in interface ComponentAddonFactory
typeIdentifier
- The ID for which a configuration addon should be created.client
- Interface to allow the addon to communicate with the client.server
- Interface to the server.AddonException
- Thrown if configuration type identifier is not supported by this factory, or if any general error occured during the configuration addon creation.public ComponentMetadata<?> getComponentMetadata(java.lang.String typeIdentifier) throws AddonException
ComponentAddonFactory
getComponentMetadata
in interface ComponentAddonFactory
typeIdentifier
- The type identifier of the configuration for which the metadata should be returned.AddonException
- Thrown if identifier is not supported by the addon.