public interface PluginDefConfig
NodePlugin within a NodeConfig.
A PluginDefConfig has the classNodePlugin and pluginId properties. These must be provided (pluginId can be null though, null being a possible value). But that does not necessarily mean that the configuration store must explicitly specify them as they can be inferred by the class specified by the pluginClass property.
This is so that it is not necessary in the the Config to specify the
plugin interface or plugin ID in the case the specified plugin implementation
class supports a default NodePlugin or plugin ID.
If pluginClass refers to a class that implements NodePluginFactory (factory
design pattern) NodePluginFactory.getDefaultClassNodePlugin() must be used by
implementations to get the value of the classNodePlugin property when not
defined. If pluginClass refers to a class that directly implements a sub-
interface of NodePlugin (constructor design pattern), it is up to the
implementation to implement a default mechanism for the classNodePlugin
property. But the following is recommended:
If pluginClass refers to a class that implements NodePluginFactory, NodePluginFactory.getDefaultPluginId must be used implementations to get the value of the pluginId property when not defined. If pluginClass refers to a class that directly implements a sub-interface of NodePlugin, it is up to the implementation to implement a default mechanism for the pluginId property. But the following is recommended:
During the design of Config and its members, it was debated whether the
responsibility for handling the default values for the classNodePlugin and
pluginId properties should be given to Config or more centrally to
Node. It was finally decided to give that responsibility to the
implementations of this interface, even if it means that the strategy needs to
be implemented in multiple places, for the following reasons:
Config| Modifier and Type | Method and Description |
|---|---|
Class<? extends NodePlugin> |
getClassNodePlugin() |
String |
getPluginClass()
Returns the plugin implementation class name.
|
String |
getPluginId() |
boolean |
isOnlyThisNode() |
Class<? extends NodePlugin> getClassNodePlugin()
String getPluginId()
String getPluginClass()
null to avoid inheritance.
This class must either implement NodePluginFactory or have a constructor
and implement the NodePlugin and the appropriate sub-interface
identified by getClassNodePlugin().
boolean isOnlyThisNode()
NodeConfig on which it is defined, as opposed to being inherited by
child NodeConfig when interpreted by the Model.Copyright © 2015–2017 AZYVA INC.. All rights reserved.