public class NodeDependencyProvider extends java.lang.Object implements DependencyProvider
DependencyProvider that should be
sufficient for most cases.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,Dependency> |
injectedDependencies
injected parameters and their dependencies
|
protected Node |
node
node determining the context for the dependency provider
|
protected Template |
template
template determining the context for the dependency provider
|
| Constructor and Description |
|---|
NodeDependencyProvider(Template template,
int nodeID)
Constructs a new
NodeDependencyProvider for the specified
process template and node. |
| Modifier and Type | Method and Description |
|---|---|
Pair<ProcessConstants.AdeptDataType,java.lang.String> |
getCompleteDataTypeOf(java.lang.String parameterName)
Returns the data type (including the UDT name if appropriate) of the
parameter with the specified name or
null if the parameter does not
exist. |
Dependency |
getDependencyOf(java.lang.String parameterName)
Returns dependency-related information about the parameter with the
specified name or
null if the parameter has currently no dependency
bound to it or the parameter does not exist. |
java.util.Map<Dependency,java.lang.String> |
getDependencyTypeArguments(java.lang.Object dependencyType,
ProcessConstants.AdeptDataType dataType,
java.lang.String udtName)
The same as
#getDependencyTypeArguments(Object, AdeptDataType, UUID) but
restricting based on the designated UDT name instead of the identifier ID. |
java.util.Map<Dependency,java.lang.String> |
getDependencyTypeArguments(java.lang.Object dependencyType,
ProcessConstants.AdeptDataType dataType,
java.util.UUID identifierID)
Returns all available dependencies for the specified dependency type in a map.
|
java.util.Map<java.lang.Object,java.lang.String> |
getDependencyTypes(ProcessConstants.AdeptDataType dataType,
java.util.UUID identifierID)
Returns all available dependency types in a map.
|
java.lang.String |
getLabelForArgument(Dependency dependency)
Returns a label text for argument of the designated dependency.
|
java.lang.String |
getLabelForType(java.lang.Object dependencyType)
Returns a label text for the given dependency type.
|
java.lang.String |
getLabelForTypeAndArgument(Dependency dependency)
Returns a label text for the designated dependency.
|
java.util.Map<java.lang.String,Dependency> |
getParameterBindings()
Returns the parameter bindings, i.e. the dependency of each parameter in a
map.
|
ParameterRef[] |
getParameters()
Returns all already existing parameters.
|
ParameterRef |
getPreferredParameter(Dependency dependency)
Returns the preferred parameter name and type for the specified dependency.
|
void |
injectDependency(java.lang.String parameterName,
Dependency dependency)
Injects an additional parameter into this dependency provider.
|
boolean |
parameterExists(java.lang.String parameterName)
Returns whether a parameter with the specified name already exists.
|
void |
removeInjectedDependency(java.lang.String parameterName)
Removes an injected parameter with the specified name from this dependency
provider.
|
protected Template template
protected final Node node
protected final java.util.Map<java.lang.String,Dependency> injectedDependencies
public NodeDependencyProvider(Template template, int nodeID)
NodeDependencyProvider for the specified
process template and node.template - template determining the context for the dependency
providernodeID - node determining the context for the dependency providerpublic ParameterRef[] getParameters()
DependencyProviderDependencyProvider.getDependencyOf(String) to retrieve dependency information about
each parameter.getParameters in interface DependencyProviderpublic java.util.Map<java.lang.String,Dependency> getParameterBindings()
getDependencyOf(String) for each
parameter returned by getParameters().public boolean parameterExists(java.lang.String parameterName)
DependencyProviderparameterExists in interface DependencyProviderparameterName - name of the parameter to be looked forpublic Dependency getDependencyOf(java.lang.String parameterName)
DependencyProvidernull if the parameter has currently no dependency
bound to it or the parameter does not exist.getDependencyOf in interface DependencyProviderparameterName - the name of the parameter for which to return
dependency-related informationpublic Pair<ProcessConstants.AdeptDataType,java.lang.String> getCompleteDataTypeOf(java.lang.String parameterName)
DependencyProvidernull if the parameter does not
exist.getCompleteDataTypeOf in interface DependencyProviderparameterName - the name of the parameter for which to return
dependency-related informationnull will be
returned. If the designated parameter is not
ProcessConstants.AdeptDataType.USERDEFINED, the second element of the pair
will be null.public java.util.Map<java.lang.Object,java.lang.String> getDependencyTypes(ProcessConstants.AdeptDataType dataType, java.util.UUID identifierID)
DependencyProviderdata type and (also optionally} an identifier ID.
The dependency types are represented by objects and used as keys in the
maps. The value is a label text created by DependencyProvider.getLabelForType(Object).
The map should have a specific, consistent order (-> e.g.
LinkedHashMap).
getDependencyTypes in interface DependencyProviderdataType - data type to limit the number of returned dependency types;
may be null for no restrictionidentifierID - identifier ID to further limit the number of returned
dependency types; may be null for no restrictionpublic java.util.Map<Dependency,java.lang.String> getDependencyTypeArguments(java.lang.Object dependencyType, ProcessConstants.AdeptDataType dataType, java.util.UUID identifierID)
DependencyProviderDependencyProvider.getLabelForType(Object).
If the dependency type does not need any arguments a singleton map with
null as key is returned. If the returned map is empty this means
that there are no valid arguments which basically renders the dependency
type unusable in the current context.
The map should have a specific, consistent order (-> e.g.
LinkedHashMap).
getDependencyTypeArguments in interface DependencyProviderdependencyType - the dependency type for which to return available
argumentsdataType - data type to limit the number of returned dependency type
argumentsidentifierID - identifier ID to further limit the number of returned
dependency type arguments; may be null for no restrictionpublic java.util.Map<Dependency,java.lang.String> getDependencyTypeArguments(java.lang.Object dependencyType, ProcessConstants.AdeptDataType dataType, java.lang.String udtName)
DependencyProvider#getDependencyTypeArguments(Object, AdeptDataType, UUID) but
restricting based on the designated UDT name instead of the identifier ID.getDependencyTypeArguments in interface DependencyProviderdependencyType - The dependency type for which to return available
arguments.dataType - The data type to limit the number of returned dependency
type arguments.udtName - The name of the UDT (in case of a UDT) to limit the number
of returned dependency type arguments. This may be
null.public java.lang.String getLabelForType(java.lang.Object dependencyType)
DependencyProvidergetLabelForType in interface DependencyProviderdependencyType - dependency type for which to return a labelpublic java.lang.String getLabelForArgument(Dependency dependency)
DependencyProvidergetLabelForArgument in interface DependencyProviderdependency - The dependency of which to receive a label of the argument.public java.lang.String getLabelForTypeAndArgument(Dependency dependency)
DependencyProvidergetLabelForTypeAndArgument in interface DependencyProviderdependency - the dependency for which to return a labelpublic ParameterRef getPreferredParameter(Dependency dependency)
DependencyProvidergetPreferredParameter in interface DependencyProviderdependency - the dependency for which to return the preferred
parameter namepublic void injectDependency(java.lang.String parameterName,
Dependency dependency)
parameterName - the name of the injected parameterdependency - the dependency of the injected parameterpublic void removeInjectedDependency(java.lang.String parameterName)
parameterName - the name of the injected parameter