IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework
Class PatternParameterDelegate

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

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

The pattern parameter delegate class specializes the abstract pattern delegate abstract class. A pattern parameter delegate enables a pattern parameter to delegate some of its behavior to another pattern definition. This class acts as an adapter, adapting the pattern parameter expand-related method interface to the pattern service's pattern manipulation interfaces.


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
PatternParameterDelegate(AbstractPatternParameter parameter, PatternDefinitionUsage usage)
          Constructs a pattern parameter delegate given a pattern parameter and a pattern definition usage.
PatternParameterDelegate(AbstractPatternParameter parameter, PatternDefinitionUsage usage, PatternParameterMapping.Provider provider)
          Constructs a pattern parameter delegate given a pattern parameter and a pattern definition usage.
 
Method Summary
 boolean expand(PatternParameterValue.Added value)
          The expand method turns around and invokes another expand method variant that takes the more general pattern parameter value.
 boolean expand(PatternParameterValue.Maintained value)
          The expand method turns around and invokes another expand method variant that takes the more general pattern parameter value.
 boolean expand(PatternParameterValue.Removed value)
          The removed variant of the expand method takes a single pattern parameter value object and adapts this call into the appropriate pattern service interface calls.
 boolean expand(PatternParameterValue.Replaced value)
          The replaced variant of the expand method takes a single pattern parameter value object and adapts this call into the appropriate pattern service interface calls.
 boolean expand(PatternParameterValue value)
          The general expand method takes a single pattern parameter value object and adapts this call into the appropriate pattern service interface calls.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternParameterDelegate

public PatternParameterDelegate(AbstractPatternParameter parameter,
                                PatternDefinitionUsage usage)
Constructs a pattern parameter delegate given a pattern parameter and a pattern definition usage. Expand methods will be delegated to parameter delegates as detailed by a pattern parameter's internal behavior. Since an explicit mapping provider is not input set up a default mappin which maps the target's first parameter to the parameter that is delegating. This is the same behavior that was present before mapping was introduced.

Parameters:
parameter - the pattern parameter to be associated with this pattern parameter delegate
usage - the pattern definition usage that defines the pattern definition to use for delegation

PatternParameterDelegate

public PatternParameterDelegate(AbstractPatternParameter parameter,
                                PatternDefinitionUsage usage,
                                PatternParameterMapping.Provider provider)
Constructs a pattern parameter delegate given a pattern parameter and a pattern definition usage. A mapping provider instance is also given as the last parameter. Expand methods will be delegated to parameter delegates as detailed by a pattern parameter's internal behavior.

Parameters:
parameter - the pattern parameter to be associated with this pattern parameter
usage - the pattern definition usage that defines the pattern definition to use for delegation
provider - the mapping provider that will be called back for mapping to take place.
Method Detail

expand

public boolean expand(PatternParameterValue value)
The general expand method takes a single pattern parameter value object and adapts this call into the appropriate pattern service interface calls. The value is passed in to the add parameter value method within the service and the expand pattern method is called on the newly acquired pattern instance.

Parameters:
value - the value involved in the pattern expansion
Returns:
true if the expand method of the used pattern definition does not stop in the middle of expanding the pattern; if false is returned on the internal expand then it will be propaged back through this return value

expand

public boolean expand(PatternParameterValue.Added value)
The expand method turns around and invokes another expand method variant that takes the more general pattern parameter value. This is typically the behavior needed by the pattern implementation.

Parameters:
value - the value to be forwarded to the more general expand method
Returns:
true if the expand method completes all notifications

expand

public boolean expand(PatternParameterValue.Maintained value)
The expand method turns around and invokes another expand method variant that takes the more general pattern parameter value. This is typically the behavior needed by the pattern implementation.

Parameters:
value - the value to be forwarded to the more general expand method
Returns:
true if the expand method completes all notifications

expand

public boolean expand(PatternParameterValue.Removed value)
The removed variant of the expand method takes a single pattern parameter value object and adapts this call into the appropriate pattern service interface calls. The value is passed in to the remove parameter value method within the service and the expand pattern method is called on the newly acquired pattern instance.

Parameters:
value - the value involved in the pattern expansion
Returns:
true if the expand method of the used pattern definition does not stop in the middle of expanding the pattern; if false is returned on the internal expand then it will be propaged back through this return value

expand

public boolean expand(PatternParameterValue.Replaced value)
The replaced variant of the expand method takes a single pattern parameter value object and adapts this call into the appropriate pattern service interface calls. The value is passed (both original value and replacement) in to the replaced parameter value method within the service and the expand pattern method is called on the newly acquired pattern instance.

Parameters:
value - the value involved in the pattern expansion
Returns:
true if the expand method of the used pattern definition does not stop in the middle of expanding the pattern; if false is returned on the internal expand then it will be propaged back through this return value

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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