|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.xtools.patterns.core.AbstractParameterArgument
com.ibm.xtools.patterns.framework.PatternParameterValue
The pattern parameter value class is a key abstraction in the framework. The pattern parameter value encapsulates all information needed to qualify a value to the proper pattern parameter and pattern instance, plus provides nested subclasses that provide state-specific behavior corresponding to the state that the pattern parameter value is currently in. The state variants of the pattern parameter value class allow for clean and consistent method overloading in the pattern parameter subclasses. For example, when an expand method is called, the specific behavior provided by the pattern author is added to the expand method with the signature referencing the pattern parameter value's direct type. This is implemented similar to the state pattern, but is different because an outside container instance is not holding on to the state. To create a value in a different state, an entire new pattern parameter value must be created and not merely swapped out internally. This paradigm seemed to fit more the design and that is why the state pattern is not followed exactly. This will be referred to as the extrinsic state pattern instead of the state or intrinsic state pattern. A pattern parameter value is the same as the argument value or the actual parameter (in contrast to the pattern parameter which is the formal parameter).
Nested Class Summary | |
static class |
PatternParameterValue.Added
The added subclass of pattern parameter value represents the state of when a pattern parameter value is added. |
static class |
PatternParameterValue.Maintained
The maintained subclass of the pattern parameter value represents the state of when a pattern parameter value is maintained (it is the current value, not added or removed). |
static class |
PatternParameterValue.Proposed
The proposed subclass of the pattern parameter value represents the state of when a pattern parameter value is proposed (it is ready for validation but its addition is contingent on the validity of the value. |
static class |
PatternParameterValue.Removed
The removed subclass of the pattern parameter value represents the state of when a pattern parameter value is removed (it has just been removed as a value) |
static class |
PatternParameterValue.Replaced
The Replaced subclass of the pattern parameter value represents the state of when a pattern parameter value is replaced by one or more values. |
static class |
PatternParameterValue.Unresolved
The unresolved subclass of the pattern parameter value represents the state of when a pattern parameter value is unresolved (this state indicates the value is in some alternate form that through a resolve can migrate to another resolved stated such as added). |
Nested classes inherited from class com.ibm.xtools.patterns.core.AbstractParameterArgument |
AbstractParameterArgument.Pair |
Method Summary | |
abstract void |
accept(com.ibm.xtools.patterns.framework.PatternParameterValue.Consumer consumer)
An abstract method that is implemented in the subclasses such as added, removed, maintained or proposed. |
AbstractParameterArgument |
getArgument()
Gets the current argument as a singular value, if multiple arguments are stored only the first is returned. |
AbstractParameterArgument[] |
getArguments()
Gets the current arguments as a multivalue. |
String |
getImage()
Retrieves a readable image of the object supplied as the argument for the parameter. |
IPatternMetatype |
getMetatype()
Retrieves the metatype of the object supplied as the argument for the parameter. |
AbstractPatternInstance |
getOwningInstance()
Get the owning instance. |
AbstractPatternParameter |
getOwningParameter()
Get the owning parameter. |
Object |
getValue()
Gets the current value as a singular value, if multiple values are stored only the first is returned. |
Object[] |
getValues()
Gets the current value as a multivalue. |
boolean |
hasValue()
Determine if this pattern parameter value has a value. |
boolean |
hasValues()
Determine if this pattern parameter value has values or a value. |
boolean |
isValueFor(AbstractPatternParameter parameter)
Determines if the parameter given has the value as specified by this instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public abstract void accept(com.ibm.xtools.patterns.framework.PatternParameterValue.Consumer consumer)
consumer
- the callback interfacepublic AbstractParameterArgument getArgument()
public AbstractParameterArgument[] getArguments()
public String getImage()
AbstractParameterArgument
Retrieves a readable image of the object supplied as the argument for the parameter.
getImage
in class AbstractParameterArgument
public IPatternMetatype getMetatype()
AbstractParameterArgument
Retrieves the metatype of the object supplied as the argument for the parameter.
Use the isValidArgumentType method to retrieve whether the object of a specific metatype is accepted as an argument of the parameter.
getMetatype
in class AbstractParameterArgument
public AbstractPatternInstance getOwningInstance()
public AbstractPatternParameter getOwningParameter()
public Object getValue()
getValue
in class AbstractParameterArgument
public Object[] getValues()
public boolean hasValue()
public boolean hasValues()
public boolean isValueFor(AbstractPatternParameter parameter)
parameter
- the parameter to check if this is a value for
|
IBM Rational Software Modeler Release 6.0 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) IBM Corp. and others 2004. All rights reserved.