IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework
Class AbstractPatternInstance

java.lang.Object
  extended bycom.ibm.xtools.patterns.core.AbstractPatternInstance
      extended bycom.ibm.xtools.patterns.framework.AbstractPatternInstance
All Implemented Interfaces:
Visitable
Direct Known Subclasses:
AbstractPatternInstance, AbstractPatternInstance.Default

public abstract class AbstractPatternInstance
extends AbstractPatternInstance
implements Visitable

This class extends the pattern service AbstractPatternInstance abstract class on the pattern author's behalf. Pattern instance is perhaps the key abstraction in the patterns framework and provides the glue that holds together the definition, the parameters, the parameter values and the run-time expansion behavior. The pattern parameter value action queue is held within this class, and contains the queue of work associated with an external expand invocation. Other methods involving parameter adds and removes as well as validation for parameter values is included. Pattern implementations can extend this base class with their own pattern instance class specific to a given pattern. The typical methods that are overridden are get representation name and expand. If this class or a closely-related subclass (such as the UML2-specific pattern instance class) is not extended and instantiated in the pattern definition's create instance factory method then the default pattern instance is used instead.


Nested Class Summary
protected static class AbstractPatternInstance.Default
          The default pattern instance class to use for pattern instances.
protected static class AbstractPatternInstance.PatternParameterValueQueue
          A simple queue implementation that is strongly-typed for pattern parameter values.
 
Field Summary
protected  AbstractPatternStore.Instance store
          The concrete pattern instance store in effect for this library and therefore this pattern instance.
 
Constructor Summary
protected AbstractPatternInstance(AbstractPatternDefinition owningPatternDefinition, Object representation)
          Constructs a new abstract pattern instance from a current pattern instance representation model element, this version of the constructor does not create a pattern instance representation.
protected AbstractPatternInstance(AbstractPatternDefinition owningPatternDefinition, Object targetObject, AbstractPatternResult createdElements, org.eclipse.core.runtime.MultiStatus status)
          Constructs a new abstract pattern instance and updates last creation date.
 
Method Summary
 void accept(Visitor visitor)
          Enable visitation of this entity.
 org.eclipse.core.runtime.IStatus addArgument(IParameterDescriptor descriptor, AbstractParameterArgument argument)
          Adds an argument and returns the status of the adding an argument operation.
 org.eclipse.core.runtime.IStatus addArguments(IParameterDescriptor descriptor, AbstractParameterArgument[] arguments)
          Adds arguments and returns the status of the adding arguments operation.
 boolean addParameterValue(IParameterDescriptor descriptor, Object value, org.eclipse.core.runtime.MultiStatus status)
           
 boolean addParameterValues(IParameterDescriptor descriptor, Object[] values, org.eclipse.core.runtime.MultiStatus status)
           
 org.eclipse.core.runtime.IStatus canCompletePattern()
          Checks whether correct and sufficient arguments have been provided for the parameters of the pattern represented by this instance, so that expansion will produce a complete and semantically valid application of the pattern.
 org.eclipse.core.runtime.IStatus createArguments(IParameterDescriptor descriptor, IPatternMetatype metatype)
          Creates the arguments for the given parameter of the pattern applied in this instance.
 org.eclipse.core.runtime.IStatus createArgumentsUsingPairs(IParameterDescriptor descriptor, IPatternMetatype metatype, AbstractParameterArgument.Pair[] pairs)
          Uses the given collection of argument pairs in creating arguments for the given parameter.
 org.eclipse.core.runtime.IStatus createSomeArguments()
          Creates arguments for all parameters of the pattern application represented by this instance for which argument creation is applicable.
protected  boolean expand()
          The default instance-directed expand method enumerates the parameters of the pattern and invokes expand with values in maintained state.
 org.eclipse.core.runtime.IStatus expandPattern(AbstractPatternResult results)
          Expands the pattern represented by this instance based on the current arguments supplied for the parameters.
 boolean expandPattern(org.eclipse.core.runtime.MultiStatus status)
           
 Object getBoundElement()
          Returns the object that is the bound element in the pattern applied in this instance.
 Date getCreationTime()
          Returns the time when this pattern application instance was created.
 AbstractParameterArgument[] getDefaultArguments(IParameterDescriptor parameter)
          Returns the default arguments, if any, for the given parameter of the pattern applied in this instance.
 AbstractParameterArgument[] getFirstArgumentCandidates(IParameterDescriptor descriptor, IPatternMetatype metatype, org.eclipse.core.runtime.MultiStatus status)
          Returns the collection of arguments that are the candidates for the first argument in an argument pair used in creating an argument for the given parameter of the pattern applied in this instance.
 Date getLastExpansionTime()
          Returns the latest expansion time for this pattern application instance.
 AbstractPatternDefinition getOwningPatternDefinition()
          Retrieves the owning pattern definition as the appropriate non-interface type.
 AbstractParameterArgument[] getParameterArguments(IParameterDescriptor parameter)
          Returns the arguments supplied for the given parameter.
 int getParameterValueCount(AbstractPatternParameter parameter)
          Given a parameter return how many values are currently bound to it.
 Object[] getParameterValues(IParameterDescriptor parameter)
           
 IPatternDescriptor getPatternDescriptor()
          Returns the descriptor for the pattern.
 Object getRepresentation()
           
 String getRepresentationName()
          The get representation name method is invoked when a name for a newly created representation element is needed.
 AbstractParameterArgument[] getSecondArgumentCandidates(IParameterDescriptor descriptor, IPatternMetatype metatype, org.eclipse.core.runtime.MultiStatus status)
          Returns the collection of arguments that are candidates for the second argument in an argument pair used in creating an argument for the given parameter of the pattern applied in this instance.
 boolean getTraceabilityEnabled()
          Checks whether traceability is enabled for the application of the pattern represented by this instance.
protected  void initialize()
          A hot-spot method that is defaulted with no implementation.
 org.eclipse.core.runtime.IStatus reapplyPattern(AbstractPatternResult results)
          Reapplies the pattern represented by this instance.
 boolean removeAllParameterValues(IParameterDescriptor descriptor)
          Remove all parameter values for the identifying parameter descriptor
 org.eclipse.core.runtime.IStatus removeArgument(IParameterDescriptor descriptor, AbstractParameterArgument argument)
          Removes the argument and returns the status of the removing the argument operation.
 org.eclipse.core.runtime.IStatus removeArguments(IParameterDescriptor descriptor, AbstractParameterArgument[] arguments)
          Removes arguments and returns the status of removing the arguments operation.
 boolean removeParameterValue(IParameterDescriptor descriptor, Object value, org.eclipse.core.runtime.MultiStatus status)
           
 boolean removeParameterValues(IParameterDescriptor descriptor, Object[] values, org.eclipse.core.runtime.MultiStatus status)
           
 org.eclipse.core.runtime.IStatus replaceArgument(IParameterDescriptor descriptor, AbstractParameterArgument oldArgument, AbstractParameterArgument newArgument)
          Replaces an argument and returns the status of replacing an argument operation.
 org.eclipse.core.runtime.IStatus replaceArguments(IParameterDescriptor descriptor, AbstractParameterArgument oldArgument, AbstractParameterArgument[] newArguments)
          Replaces arguments and returns the status of replacing the arguments operation.
 boolean resetDefaultParameterValues(IParameterDescriptor descriptor, org.eclipse.core.runtime.MultiStatus status)
           
 boolean resetDefaultParameterValues(org.eclipse.core.runtime.MultiStatus status)
           
 org.eclipse.core.runtime.IStatus setTraceabilityEnabled(boolean enableTraceability)
          Sets whether traceability is enabled for the application of the pattern represented by this instance.
 org.eclipse.core.runtime.IStatus unapplyPattern(AbstractPatternResult results)
          Unapplies the pattern represented by this instance.
 boolean unapplyPattern(org.eclipse.core.runtime.MultiStatus status)
           
abstract  boolean unapplyPattern(org.eclipse.uml2.TemplateableElement t, ArrayList list_o_PAE)
           
 org.eclipse.core.runtime.IStatus usesPairsToCreateArguments(IParameterDescriptor descriptor, IPatternMetatype metatype)
          Indicates whether the argument pairs must be supplied in order to create arguments for the given parameter of the pattern applied in this instance.
 org.eclipse.core.runtime.IStatus validatePattern()
          Checks whether the application of the pattern represented by this instance is complete and semantically valid.
 boolean validatePattern(org.eclipse.core.runtime.MultiStatus status)
           
 org.eclipse.core.runtime.IStatus validToAddArgument(IParameterDescriptor descriptor, AbstractParameterArgument argument)
          Returns the validation status for adding an argument operation.
 org.eclipse.core.runtime.IStatus validToAddArguments(IParameterDescriptor descriptor, AbstractParameterArgument[] arguments)
          Returns the validation status for the adding arguments operation.
 org.eclipse.core.runtime.IStatus validToCreateArguments(IParameterDescriptor descriptor, IPatternMetatype metatype)
          Indicates whether arguments can be created for the given parameter of the pattern applied in this instance.
 org.eclipse.core.runtime.IStatus validToCreateSomeArguments()
          Indicates whether for all parameters of the pattern application represented by this instance either arguments can be created for the parameter or argument creation is not applicable to the parameter.
 org.eclipse.core.runtime.IStatus validToRemoveArgument(IParameterDescriptor parameter, AbstractParameterArgument argument)
          Returns the validation status for removing an argument operation.
 org.eclipse.core.runtime.IStatus validToRemoveArguments(IParameterDescriptor parameter, AbstractParameterArgument[] arguments)
          Returns the validation status for the remove the arguments operation.
 org.eclipse.core.runtime.IStatus validToReplaceArgument(IParameterDescriptor parameter, AbstractParameterArgument oldArgument, AbstractParameterArgument newArgument)
          Returns the validation status for replacing an argument operation.
 org.eclipse.core.runtime.IStatus validToReplaceArguments(IParameterDescriptor parameter, AbstractParameterArgument oldArgument, AbstractParameterArgument[] newArguments)
          Returns the validation status for replacing the arguments operation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

store

protected final AbstractPatternStore.Instance store
The concrete pattern instance store in effect for this library and therefore this pattern instance.

Constructor Detail

AbstractPatternInstance

protected AbstractPatternInstance(AbstractPatternDefinition owningPatternDefinition,
                                  Object representation)
Constructs a new abstract pattern instance from a current pattern instance representation model element, this version of the constructor does not create a pattern instance representation. It is used for reconstituting persisted pattern instances.

Parameters:
owningPatternDefinition - the definition that governs this persistent store pattern instance representation
representation - the representation used as a seed to reconsitute this abstract pattern instance

AbstractPatternInstance

protected AbstractPatternInstance(AbstractPatternDefinition owningPatternDefinition,
                                  Object targetObject,
                                  AbstractPatternResult createdElements,
                                  org.eclipse.core.runtime.MultiStatus status)
Constructs a new abstract pattern instance and updates last creation date. This constructor assumes that the representation in the model is not yet created and creates a new pattern instance representation according to the element given as the target object. Typically the target object would be the containing element that this representation instance would be created in. If an owning pattern definition defines zero parameters then the expand pattern method is called right away since no additional parameters could possibly be specified.

Parameters:
owningPatternDefinition - the definition that governs this instance
targetObject - the target object is the context when creating the new pattern instance representation
createdElements - if any additional model elements are created they are returned here
status - the status generated by the construction of the pattern instance is return here
Method Detail

accept

public void accept(Visitor visitor)
Enable visitation of this entity.

Specified by:
accept in interface Visitable

validToAddArgument

public org.eclipse.core.runtime.IStatus validToAddArgument(IParameterDescriptor descriptor,
                                                           AbstractParameterArgument argument)
Description copied from class: AbstractPatternInstance
Returns the validation status for adding an argument operation.

Specified by:
validToAddArgument in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given argument is tested for validity.
argument - The parameter argument to be tested for validity as an argument for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches()to branch on the return value.

validToAddArguments

public org.eclipse.core.runtime.IStatus validToAddArguments(IParameterDescriptor descriptor,
                                                            AbstractParameterArgument[] arguments)
Description copied from class: AbstractPatternInstance
Returns the validation status for the adding arguments operation.

Specified by:
validToAddArguments in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are tested for validity.
arguments - The arguments to be tested for validity.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches()to branch on the return value.

addArgument

public org.eclipse.core.runtime.IStatus addArgument(IParameterDescriptor descriptor,
                                                    AbstractParameterArgument argument)
Description copied from class: AbstractPatternInstance
Adds an argument and returns the status of the adding an argument operation.

Specified by:
addArgument in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given argument is supplied.
argument - The argument supplied for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches()to branch on the return value.

addArguments

public org.eclipse.core.runtime.IStatus addArguments(IParameterDescriptor descriptor,
                                                     AbstractParameterArgument[] arguments)
Description copied from class: AbstractPatternInstance
Adds arguments and returns the status of the adding arguments operation.

Specified by:
addArguments in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are supplied.
arguments - The arguments supplied for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

addParameterValue

public final boolean addParameterValue(IParameterDescriptor descriptor,
                                       Object value,
                                       org.eclipse.core.runtime.MultiStatus status)

addParameterValues

public final boolean addParameterValues(IParameterDescriptor descriptor,
                                        Object[] values,
                                        org.eclipse.core.runtime.MultiStatus status)

canCompletePattern

public org.eclipse.core.runtime.IStatus canCompletePattern()
Description copied from class: AbstractPatternInstance
Checks whether correct and sufficient arguments have been provided for the parameters of the pattern represented by this instance, so that expansion will produce a complete and semantically valid application of the pattern.

Specified by:
canCompletePattern in class AbstractPatternInstance
Returns:
The status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

validToCreateArguments

public org.eclipse.core.runtime.IStatus validToCreateArguments(IParameterDescriptor descriptor,
                                                               IPatternMetatype metatype)
Description copied from class: AbstractPatternInstance
Indicates whether arguments can be created for the given parameter of the pattern applied in this instance.

Specified by:
validToCreateArguments in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which arguments are to be created.
metatype - The desired type of the arguments to be created.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

validToCreateSomeArguments

public org.eclipse.core.runtime.IStatus validToCreateSomeArguments()
Description copied from class: AbstractPatternInstance
Indicates whether for all parameters of the pattern application represented by this instance either arguments can be created for the parameter or argument creation is not applicable to the parameter.

Specified by:
validToCreateSomeArguments in class AbstractPatternInstance
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches()to branch on the return value.

createArguments

public org.eclipse.core.runtime.IStatus createArguments(IParameterDescriptor descriptor,
                                                        IPatternMetatype metatype)
Description copied from class: AbstractPatternInstance
Creates the arguments for the given parameter of the pattern applied in this instance.

Specified by:
createArguments in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which arguments are to be created.
metatype - The desired type of the arguments to be created.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

usesPairsToCreateArguments

public org.eclipse.core.runtime.IStatus usesPairsToCreateArguments(IParameterDescriptor descriptor,
                                                                   IPatternMetatype metatype)
Description copied from class: AbstractPatternInstance
Indicates whether the argument pairs must be supplied in order to create arguments for the given parameter of the pattern applied in this instance.

Specified by:
usesPairsToCreateArguments in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which arguments are to be created.
metatype - The desired type of the arguments to be created.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value. Either an ERROR or CANCEL status can be used to indicate that pairs are not used to create arguments. An INFO status can be used to convey information to the caller about the semantics of the pairs used as arguments; the message in the status should be appropriate, for example, to be displayed in a dialog prompting the user to select pairs as arguments.

getFirstArgumentCandidates

public AbstractParameterArgument[] getFirstArgumentCandidates(IParameterDescriptor descriptor,
                                                              IPatternMetatype metatype,
                                                              org.eclipse.core.runtime.MultiStatus status)
Description copied from class: AbstractPatternInstance
Returns the collection of arguments that are the candidates for the first argument in an argument pair used in creating an argument for the given parameter of the pattern applied in this instance.

Specified by:
getFirstArgumentCandidates in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which first argument candidates are to be return.
metatype - The desired type of the arguments to be created.
status - The status produced by getting the first argument candidates. An INFO status can be used to convey information to the caller about the semantics of the first argument candidates, for example, that the first argument is source element of a relationship.
Returns:
Returns the collection of arguments that are candidates for the first argument in an argument pair.

getSecondArgumentCandidates

public AbstractParameterArgument[] getSecondArgumentCandidates(IParameterDescriptor descriptor,
                                                               IPatternMetatype metatype,
                                                               org.eclipse.core.runtime.MultiStatus status)
Description copied from class: AbstractPatternInstance
Returns the collection of arguments that are candidates for the second argument in an argument pair used in creating an argument for the given parameter of the pattern applied in this instance.

Specified by:
getSecondArgumentCandidates in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which second argument candidates are to be return.
metatype - The desired type of the arguments to be created.
status - The status produced by getting the second argument candidates. An INFO status can be used to convey information to the caller about the semantics of the second argument candidates, for example, that the second argument is target element of a relationship.
Returns:
Returns the collection of arguments that are candidates for the second argument in an argument pair.

createArgumentsUsingPairs

public org.eclipse.core.runtime.IStatus createArgumentsUsingPairs(IParameterDescriptor descriptor,
                                                                  IPatternMetatype metatype,
                                                                  AbstractParameterArgument.Pair[] pairs)
Description copied from class: AbstractPatternInstance
Uses the given collection of argument pairs in creating arguments for the given parameter.

Specified by:
createArgumentsUsingPairs in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for arguments are to be created.
metatype - The desired type of the arguments to be created.
pairs - The collection of argument pairs to be used in creating arguments of the given type for the given parameter
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

createSomeArguments

public org.eclipse.core.runtime.IStatus createSomeArguments()
Description copied from class: AbstractPatternInstance
Creates arguments for all parameters of the pattern application represented by this instance for which argument creation is applicable.

Specified by:
createSomeArguments in class AbstractPatternInstance
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

expand

protected boolean expand()
The default instance-directed expand method enumerates the parameters of the pattern and invokes expand with values in maintained state. Typically this method does not have to be overridden in subclasses since it implements default behavior that is usually desired. Cases where it is overridden include patterns that have no defined parameters since no expands would take place by default (there are no parameters to direct an expand at).

Returns:
indicates whether or not the expand was handled by this method or a method invoked from it

expandPattern

public org.eclipse.core.runtime.IStatus expandPattern(AbstractPatternResult results)
Description copied from class: AbstractPatternInstance
Expands the pattern represented by this instance based on the current arguments supplied for the parameters.

Specified by:
expandPattern in class AbstractPatternInstance
Parameters:
results - The results of the expanding the pattern.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

expandPattern

public final boolean expandPattern(org.eclipse.core.runtime.MultiStatus status)

getBoundElement

public final Object getBoundElement()
Description copied from class: AbstractPatternInstance
Returns the object that is the bound element in the pattern applied in this instance.

Specified by:
getBoundElement in class AbstractPatternInstance
Returns:
Returns the object bound to the pattern applied in this instance, if any. If no object is bound to the applied pattern, it returns null.

getDefaultArguments

public AbstractParameterArgument[] getDefaultArguments(IParameterDescriptor parameter)
Description copied from class: AbstractPatternInstance
Returns the default arguments, if any, for the given parameter of the pattern applied in this instance.

Specified by:
getDefaultArguments in class AbstractPatternInstance
Parameters:
parameter - The descriptor of the parameter of the pattern applied in this instance for which the default arguments are to be returned.
Returns:
Returns the default arguments for the given parameter in this instance.

getOwningPatternDefinition

public final AbstractPatternDefinition getOwningPatternDefinition()
Retrieves the owning pattern definition as the appropriate non-interface type. Used for framework collaborating classes that need more than just the interface that is exposed to the pattern service.

Returns:
the definition that owns this instance

getParameterArguments

public AbstractParameterArgument[] getParameterArguments(IParameterDescriptor parameter)
Description copied from class: AbstractPatternInstance
Returns the arguments supplied for the given parameter.

Specified by:
getParameterArguments in class AbstractPatternInstance
Parameters:
parameter - The descriptor of the parameter of the pattern applied in this instance for which the arguments are to be returned.
Returns:
Returns the arguments, if any, that have been supplied for the given parameter. If no arguments have been supplied, it returns a zero-length array.

getParameterValueCount

public final int getParameterValueCount(AbstractPatternParameter parameter)
Given a parameter return how many values are currently bound to it.

Parameters:
parameter - the parameter determines which values to count
Returns:
the size or length of the parameter value list

getParameterValues

public final Object[] getParameterValues(IParameterDescriptor parameter)

getPatternDescriptor

public final IPatternDescriptor getPatternDescriptor()
Description copied from class: AbstractPatternInstance
Returns the descriptor for the pattern.

The descriptor includes simple information such as the name, unique id, version, the author of the pattern and complex information such as descriptors for the parameters of the pattern.

Specified by:
getPatternDescriptor in class AbstractPatternInstance
Returns:
Returns the descriptor for the pattern that was applied in this instance.

getRepresentation

public final Object getRepresentation()
Returns:
the representation object for this pattern instance in the model, the representation object is the object that is used for persisting pattern instances within the current pattern instance store

getRepresentationName

public String getRepresentationName()
The get representation name method is invoked when a name for a newly created representation element is needed.

Returns:
a name to assign the representation element in the model, could be unique per instance but based on a pattern definition name

initialize

protected void initialize()
A hot-spot method that is defaulted with no implementation. It is recommended that all custom pattern instance constructor code be put in the pattern instance initialize method rather than in the constructor. This method will be invoked after a new pattern instance has been constructed (either a new pattern instance or a reconstituted one).


reapplyPattern

public org.eclipse.core.runtime.IStatus reapplyPattern(AbstractPatternResult results)
Description copied from class: AbstractPatternInstance
Reapplies the pattern represented by this instance.

Specified by:
reapplyPattern in class AbstractPatternInstance
Parameters:
results - The results of the reapplying the pattern.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

validToRemoveArgument

public org.eclipse.core.runtime.IStatus validToRemoveArgument(IParameterDescriptor parameter,
                                                              AbstractParameterArgument argument)
Description copied from class: AbstractPatternInstance
Returns the validation status for removing an argument operation.

Specified by:
validToRemoveArgument in class AbstractPatternInstance
Parameters:
parameter - The descriptor of the parameter of the pattern applied in this instance for which the given argument is tested for removal.
argument - The argument to be tested for removal for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

removeArgument

public org.eclipse.core.runtime.IStatus removeArgument(IParameterDescriptor descriptor,
                                                       AbstractParameterArgument argument)
Description copied from class: AbstractPatternInstance
Removes the argument and returns the status of the removing the argument operation.

Specified by:
removeArgument in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given argument is to be removed.
argument - The argument to be removed for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

validToRemoveArguments

public org.eclipse.core.runtime.IStatus validToRemoveArguments(IParameterDescriptor parameter,
                                                               AbstractParameterArgument[] arguments)
Description copied from class: AbstractPatternInstance
Returns the validation status for the remove the arguments operation.

Specified by:
validToRemoveArguments in class AbstractPatternInstance
Parameters:
parameter - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are to be tested for removal.
arguments - The arguments to be tested for removal for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

removeArguments

public org.eclipse.core.runtime.IStatus removeArguments(IParameterDescriptor descriptor,
                                                        AbstractParameterArgument[] arguments)
Description copied from class: AbstractPatternInstance
Removes arguments and returns the status of removing the arguments operation.

Specified by:
removeArguments in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are to be removed.
arguments - The arguments to be removed for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

removeParameterValue

public final boolean removeParameterValue(IParameterDescriptor descriptor,
                                          Object value,
                                          org.eclipse.core.runtime.MultiStatus status)

removeParameterValues

public final boolean removeParameterValues(IParameterDescriptor descriptor,
                                           Object[] values,
                                           org.eclipse.core.runtime.MultiStatus status)

removeAllParameterValues

public boolean removeAllParameterValues(IParameterDescriptor descriptor)
Remove all parameter values for the identifying parameter descriptor

Parameters:
descriptor - the parameter descriptor identifying the parameter values to remove
Returns:
true indicates success of removing all the parameter values.

validToReplaceArgument

public org.eclipse.core.runtime.IStatus validToReplaceArgument(IParameterDescriptor parameter,
                                                               AbstractParameterArgument oldArgument,
                                                               AbstractParameterArgument newArgument)
Description copied from class: AbstractPatternInstance
Returns the validation status for replacing an argument operation.

Specified by:
validToReplaceArgument in class AbstractPatternInstance
Parameters:
parameter - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are tested as a valid replacement.
oldArgument - The argument to be tested for validity as the replaceable argument for the given parameter.
newArgument - The argument to be tested for validity as the replacement argument for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

replaceArgument

public org.eclipse.core.runtime.IStatus replaceArgument(IParameterDescriptor descriptor,
                                                        AbstractParameterArgument oldArgument,
                                                        AbstractParameterArgument newArgument)
Description copied from class: AbstractPatternInstance
Replaces an argument and returns the status of replacing an argument operation.

Specified by:
replaceArgument in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are supplied for replacement.
oldArgument - The argument to be replaced for the given parameter.
newArgument - The argument to be the replacement argument for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

validToReplaceArguments

public org.eclipse.core.runtime.IStatus validToReplaceArguments(IParameterDescriptor parameter,
                                                                AbstractParameterArgument oldArgument,
                                                                AbstractParameterArgument[] newArguments)
Description copied from class: AbstractPatternInstance
Returns the validation status for replacing the arguments operation.

Specified by:
validToReplaceArguments in class AbstractPatternInstance
Parameters:
parameter - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are tested as a valid replacement.
oldArgument - The single argument to be tested as replaceable for the given parameter.
newArguments - The arguments to be tested as replacements for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

replaceArguments

public org.eclipse.core.runtime.IStatus replaceArguments(IParameterDescriptor descriptor,
                                                         AbstractParameterArgument oldArgument,
                                                         AbstractParameterArgument[] newArguments)
Description copied from class: AbstractPatternInstance
Replaces arguments and returns the status of replacing the arguments operation.

Specified by:
replaceArguments in class AbstractPatternInstance
Parameters:
descriptor - The descriptor of the parameter of the pattern applied in this instance for which the given arguments are supplied replacements.
oldArgument - The argument supplied as replaceable for the given parameter.
newArguments - The arguments supplied as replacements for the given parameter.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

resetDefaultParameterValues

public final boolean resetDefaultParameterValues(IParameterDescriptor descriptor,
                                                 org.eclipse.core.runtime.MultiStatus status)

resetDefaultParameterValues

public final boolean resetDefaultParameterValues(org.eclipse.core.runtime.MultiStatus status)

unapplyPattern

public org.eclipse.core.runtime.IStatus unapplyPattern(AbstractPatternResult results)
Description copied from class: AbstractPatternInstance
Unapplies the pattern represented by this instance.

Specified by:
unapplyPattern in class AbstractPatternInstance
Parameters:
results - The results of the unapplying the pattern.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

unapplyPattern

public boolean unapplyPattern(org.eclipse.core.runtime.MultiStatus status)

validatePattern

public org.eclipse.core.runtime.IStatus validatePattern()
Description copied from class: AbstractPatternInstance
Checks whether the application of the pattern represented by this instance is complete and semantically valid.

Specified by:
validatePattern in class AbstractPatternInstance
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

validatePattern

public boolean validatePattern(org.eclipse.core.runtime.MultiStatus status)

unapplyPattern

public abstract boolean unapplyPattern(org.eclipse.uml2.TemplateableElement t,
                                       ArrayList list_o_PAE)

getCreationTime

public final Date getCreationTime()
Description copied from class: AbstractPatternInstance
Returns the time when this pattern application instance was created.

Specified by:
getCreationTime in class AbstractPatternInstance
Returns:
Returns the time when the pattern application represented by this instance was created.

getLastExpansionTime

public final Date getLastExpansionTime()
Description copied from class: AbstractPatternInstance
Returns the latest expansion time for this pattern application instance.

Specified by:
getLastExpansionTime in class AbstractPatternInstance
Returns:
Returns the most recent time when the pattern application represented by this instance was expanded.

getTraceabilityEnabled

public boolean getTraceabilityEnabled()
Description copied from class: AbstractPatternInstance
Checks whether traceability is enabled for the application of the pattern represented by this instance.

Specified by:
getTraceabilityEnabled in class AbstractPatternInstance
Returns:
Returns true if traceability is enabled for the application of the pattern represented by this instance; otherwise, it returns false.

setTraceabilityEnabled

public org.eclipse.core.runtime.IStatus setTraceabilityEnabled(boolean enableTraceability)
Description copied from class: AbstractPatternInstance
Sets whether traceability is enabled for the application of the pattern represented by this instance.

Specified by:
setTraceabilityEnabled in class AbstractPatternInstance
Parameters:
enableTraceability - The boolean indication of whether to set traceability enabled for the application of the pattern represented by this instance. If enableTraceability is true then traceability is to be set to enabled.
Returns:
Returns the status representing the outcome of the operation. Use IStatus.isOk() or IStatus.matches() to branch on the return value.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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