IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework
Class PatternDependencyDelegate

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.AbstractPatternDelegate
      extended bycom.ibm.xtools.patterns.framework.PatternDependencyDelegate

public class PatternDependencyDelegate
extends com.ibm.xtools.patterns.framework.AbstractPatternDelegate

A pattern dependency delegate 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 off 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.fs The default behavior is that of adaptation; that is, this 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 delegates to the different interface that the pattern service exposes.

See Also:
AbstractPatternDelegate, PatternParameterDelegate

Nested Class Summary
static class com.ibm.xtools.patterns.framework.AbstractPatternDelegate.Adapter
          An adapter provider allows for stepping through of all the pattern parameter mappings in order to adapt the outer state to the inner state and adapt this call on to the interface of the pattern service calls.
 
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)
          The update method is delegated to the more general update method variant.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Added dependency)
          The update method is delegated to the more general update method variant.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Maintained dependency)
          The update method is delegated to the more general update method variant.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Removed dependency)
          The update method adapts the maintained removed value state combination into the respectively matched pattern service method invocations.
 boolean update(PatternParameterValue.Maintained dependent, PatternParameterValue.Replaced dependency)
          The update method adapts the maintained replaced value state combination into the respectively matched pattern service method invocations.
 boolean update(PatternParameterValue.Removed dependent, PatternParameterValue.Maintained dependency)
          The update method adapts the removed maintained value state combination into the respectively matched pattern service method invocations.
 boolean update(PatternParameterValue.Replaced dependent, PatternParameterValue.Maintained dependency)
          The update method adapts the replaced maintained value state combination into the respectively matched pattern service method invocations.
 boolean update(PatternParameterValue dependent, PatternParameterValue dependency)
          The general update method is called if the pattern parameter values are not more specifically typed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternDependencyDelegate

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 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 which pattern definition to delegate pattern behavior to

PatternDependencyDelegate

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 to associated with this delegate, a dependency can have zero to many delegates associated
usage - the pattern definition usage specifies which pattern definition to delegate pattern behavior to
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

update

public boolean update(PatternParameterValue dependent,
                      PatternParameterValue dependency)
The general update method 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). 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.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed

update

public boolean update(PatternParameterValue.Added dependent,
                      PatternParameterValue.Maintained dependency)
The update method is delegated to the more general update method variant.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed
See Also:
update(PatternParameterValue, PatternParameterValue)

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Added dependency)
The update method is delegated to the more general update method variant.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed
See Also:
update(PatternParameterValue, PatternParameterValue)

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Maintained dependency)
The update method is delegated to the more general update method variant.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed
See Also:
update(PatternParameterValue, PatternParameterValue)

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Removed dependency)
The update method 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.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed

update

public boolean update(PatternParameterValue.Maintained dependent,
                      PatternParameterValue.Replaced dependency)
The update method 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.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed

update

public boolean update(PatternParameterValue.Removed dependent,
                      PatternParameterValue.Maintained dependency)
The update method 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.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed

update

public boolean update(PatternParameterValue.Replaced dependent,
                      PatternParameterValue.Maintained dependency)
The update method 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.

Parameters:
dependent - the dependent parameter value in the dependency
dependency - the dependency parameter value in the dependency
Returns:
true if the expansion choosed to nofity dependents and not stop the expansion path midway through an expansion; an expansion path is the code path taken as a pattern expansion is being executed

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.