| Java API Reference | Class Hierarchy | All Classes | All Fields and Methods |
com.ibm.xtools.patterns.framework
+-- AbstractPatternDelegate +-- PatternDependencyDelegate
public Class PatternDependencyDelegate
extends AbstractPatternDelegate
Specializes an abstract pattern delegate and provides a concrete implementation of a pattern dependency delegate that requires an abstract pattern dependency and a pattern definition usage instance to be constructed.
A pattern dependency delegate enables pattern dependency implementations to delegate some of the behavior that a dependency is responsible for into another pattern (or transform or arbitrary code). For now only pattern delegates are supported.
It is typically not necessary to override any of the included methods in this class, but it is possible if needed for specializing delegate behavior. The default behavior is that of adaptation. The code delegates the behavior that a dependency typically implements (responding to the update methods for example) and translates these method calls into the appropriate pattern service calls to satisfy the intended resultant behavior.
The dependency update interface is adapted so update calls can be delegated to the different interface that the pattern service exposes.
| Constructor summary |
|---|
| PatternDependencyDelegate(AbstractPatternDependency dependency, PatternDefinitionUsage usage) Constructs a pattern dependency delegate using the specified dependency and pattern definition usage. |
| PatternDependencyDelegate(AbstractPatternDependency dependency, PatternDefinitionUsage usage, PatternParameterMapping.Provider provider) Constructs a pattern dependency delegate using the specified dependency and pattern definition usage. |
| Method summary | |
|---|---|
| boolean | update(PatternParameterValue.Added dependent, PatternParameterValue.Maintained dependency) Represents the update method that is delegated to the more general update method variant. |
| boolean | update(PatternParameterValue.Maintained dependent, PatternParameterValue.Added dependency) Represents the update method that is delegated to the more general update method variant. |
| boolean | update(PatternParameterValue.Maintained dependent, PatternParameterValue.Maintained dependency) Represents the update method that is delegated to the more general update method variant. |
| boolean | update(PatternParameterValue.Maintained dependent, PatternParameterValue.Removed dependency) Represents the update method that adapts the maintained removed value state combination into the respectively matched pattern service method invocations. |
| boolean | update(PatternParameterValue.Maintained dependent, PatternParameterValue.Replaced dependency) Represents the update method that adapts the maintained replaced value state combination into the respectively matched pattern service method invocations. |
| boolean | update(PatternParameterValue.Removed dependent, PatternParameterValue.Maintained dependency) Represents the update method that adapts the removed maintained value state combination into the respectively matched pattern service method invocations. |
| boolean | update(PatternParameterValue.Replaced dependent, PatternParameterValue.Maintained dependency) Represents the update method that adapts the replaced maintained value state combination into the respectively matched pattern service method invocations. |
| boolean | update(PatternParameterValue dependent, PatternParameterValue dependency) Represents the general update method that is called if the pattern parameter values are not more specifically typed. |
Constructor detail
public PatternDependencyDelegate(AbstractPatternDependency dependency, PatternDefinitionUsage usage)
Constructs a pattern dependency delegate using the specified dependency and pattern definition usage.
The dependency passed in will receive a call to add this delegate to the delegate list of the dependency. This constructor does not take a mapping provider so one is supplied automatically that provides the same behavior that was present before the explicit mapping was introduced.
The default mapping is to map the dependency parameter of the dependency delegating to the first parameter of the delegate pattern, and to map the dependent parameter of the dependency delegating to the second parameter of the delegate pattern.
Parameters:
| dependency | - The dependency to associated with this delegate, a dependency can have zero to many delegates associated. |
| usage | - The pattern definition usage specifies to which pattern definition to delegate pattern behavior. |
public PatternDependencyDelegate(AbstractPatternDependency dependency, PatternDefinitionUsage usage, PatternParameterMapping.Provider provider)
Constructs a pattern dependency delegate using the specified dependency and pattern definition usage.
The dependency passed in will receive a call to add this delegate to the delegate list of the dependency.
Parameters:
| dependency | - The dependency associated with this delegate. A dependency can have zero to many delegates associated. |
| usage | - The pattern definition usage specifies to which pattern definition to delegate pattern behavior. |
| provider | - The pattern parameter mapping provider to use for this delegate. The provider allows for the definition of target parameter values via parameter mapping and literal specification. |
Method detail
public boolean update(PatternParameterValue.Added dependent, PatternParameterValue.Maintained dependency)
Represents the update method that is delegated to the more general update method variant.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |
public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Added dependency)
Represents the update method that is delegated to the more general update method variant.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |
public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Maintained dependency)
Represents the update method that is delegated to the more general update method variant.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |
public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Removed dependency)
Represents the update method that adapts the maintained removed value state combination into the respectively matched pattern service method invocations.
The maintained value is translated into an add parameter value call and the removed value translates into a remove parameter value call. The expand pattern method is called after the values have been added and removed and then the expansion status is returned.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |
public boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Replaced dependency)
Represents the update method that adapts the maintained replaced value state combination into the respectively matched pattern service method invocations.
The maintained value is translated into an add parameter value call and the replaced value translates into a replace parameter value call. The expand pattern method is called after the values have been added and removed and then the expansion status is returned.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |
public boolean update(PatternParameterValue.Removed dependent, PatternParameterValue.Maintained dependency)
Represents the update method that adapts the removed maintained value state combination into the respectively matched pattern service method invocations.
The removed value is translated into a removed parameter value call and the maintained value translates into an add parameter value call. The expand pattern method is called after the values have been removed and added and then the expansion status is returned.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |
public boolean update(PatternParameterValue.Replaced dependent, PatternParameterValue.Maintained dependency)
Represents the update method that adapts the replaced maintained value state combination into the respectively matched pattern service method invocations.
The maintained value is translated into an add parameter value call and the replaced value translates into a replace parameter value call. The expand pattern method is called after the values have been added and removed and then the expansion status is returned.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |
public boolean update(PatternParameterValue dependent, PatternParameterValue dependency)
Represents the general update method that is called if the pattern parameter values are not more specifically typed.
This method first retrieves the pattern instance that represents the used pattern definition (it might be created new or it might be retrieved from a persistent pattern instance store).
The parameter values are added for parameters involved in the delegation. The expand pattern method is then called to perform the pattern instance expansion. After a pattern expansion completes the pattern instance used for delegation purposes is removed from the persistent pattern instance store and the expansion status is returned.
An expansion path is the code path taken as a pattern expansion is being executed.
Parameters:
| dependent | - The dependent parameter value in the dependency. |
| dependency | - The dependency parameter value in the dependency. |
Returns:
A boolean value of true if the expansion is chosen to notify dependents and not stop the expansion path midway through an expansion. Otherwise, it returns a value of false. |