|
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.framework.AbstractPatternElement
com.ibm.xtools.patterns.framework.AbstractPatternDefinition
This is the base abstract pattern definition class. A pattern definition represents a pattern and provides an abstraction in the framework that can be used to determine information about a pattern. If a pattern is statically-defined is will have a descriptor found in the pattern library's plugin.xml file that conforms to the pattern providers XML schema. Whether a pattern is statically-defined or dynamically-defined the abstract pattern definition class will behave and look the same to the client. Client in this context means anything that holds on to an abstract pattern definition type. The actual pattern descriptor instance as defined by the pattern service is referenced by this class as an instance variable. For patterns that are statically-defined, the descriptor is served-up by the pattern service implementation and the pattern definition specializing class need only use the superclass constructor with the minimal parameters needed to associate the implementation with the descriptor. For patterns that are dyanamically-defined, the descriptor is created using the information supplied to the abstract pattern definition in its constructor by subclasses. There are currently two strategies for implementing pattern descriptors, one strategy is implemented by the pattern service and the other strategy is implemented within the framework, within this class's descriptor member class. The intent of this class is to provide a base class for concrete pattern definitions to extend. There are also other classes that extend from this class that might provide more appropriate base classes for defining concrete pattern definitions. For example, there is an abstract pattern definition class that is UML2-specific that is part of the framework and there might be other classes that extend from this class specializing the base pattern definition for another specific metamodel or purpose. The typical scenario would be that a pattern implementation would subclass this class or another closely-related subclass of this class and then implement the proper constructor which invokes the superclass constructor appropriately depending on whether the pattern definition is statically or dynamically-defined. One optional hot-spot that can be overridden in this class is the factory method for creating pattern instances for this particular pattern definition. By default, a general pattern instance class is used to create a pattern instance for this pattern definition. This general pattern instance implementation is most appropriate for pattern definitions that define pattern parameters since the pattern's execution behavior is primarily directed by its parameters in this case. Another optional hot-spot that can be overridden in this class is the is valid method that determines if a pattern instantiation of this pattern definition type can occur given a certain context.
createPatternInstance(Object, AbstractPatternResult, MultiStatus),
reconstitutePatternInstance(AbstractPatternDefinition, Object),
isValid(org.eclipse.emf.ecore.EObject),
AbstractPatternInstance,
AbstractPatternDefinition,
IPatternDescriptor| Field Summary |
| Fields inherited from interface com.ibm.xtools.patterns.core.IPatternDescriptor |
DIAGRAM, DIAGRAM_DELIMITERS, DOCUMENTATION, MANIFEST, MODEL, OVERVIEW_DIAGRAM, PLUGIN_NAME, PLUGIN_URL, TARGET_TYPE, TARGET_TYPE_DELIMITERS, TEMPLATE, TYPE |
| Fields inherited from interface com.ibm.xtools.transform.core.ITransformationDescriptor |
AUTHOR, DESCRIPTION, DOCUMENT, EXTENSIBLE, GROUP_PATH, GROUP_PATH_DELIMITERS, ICON, ID, KEYWORDS, KEYWORDS_DELIMITERS, NAME, PROFILES, PROFILES_DELIMITERS, PROVIDER, PUBLIC, SOURCE_MODEL_TYPE, SOURCE_MODEL_TYPE_DELIMITERS, TARGET_MODEL_TYPE, TARGET_MODEL_TYPE_DELIMITERS, TRANSFORM_GUI, VERSION |
| Constructor Summary | |
protected |
AbstractPatternDefinition(PatternIdentity identity)
Constructs an abstract pattern definition given only a pattern identity. |
| Method Summary | |
void |
accept(Visitor visitor)
Enable visitation of this entity. |
int |
compareTo(Object object)
|
protected AbstractPatternInstance |
createPatternInstance(Object targetObject,
AbstractPatternResult results,
MultiStatus status)
A method that is called when a new pattern instance is requested to be created. |
boolean |
equals(Object object)
|
IAdaptable |
getAdaptableProperty(String propertyId)
Returns the property with the given property id that is implemented as an adaptable object. |
String[] |
getAssignedGroups()
Returns the string paths of groups to which the pattern represented by this pattern descriptor is assigned. |
IPatternMetatype[] |
getContainerTypes()
Returns the types of elements that are valid containers for an instance of the pattern represented by this pattern descriptor. |
String |
getDescription()
Retrieve the localized description of the transformation item. |
String |
getId()
Retrieve the unique id of the transformation item. |
IPatternIdentity |
getIdentity()
Returns the composite identity of the pattern represented by this pattern descriptor. |
String[] |
getKeywords()
Returns the keywords associated with the pattern represented by this pattern descriptor. |
String |
getName()
Retrieve the localized name of the transformation item. |
IParameterDescriptor[] |
getParameters()
Returns the parameters for the pattern represented by this pattern descriptor. |
ITransformationProperty[] |
getProperties()
Return all defined properties associated with this transformation. |
ITransformationProperty |
getProperty(String propertyId)
Return the specified property associated with this transformation. |
String[] |
getPropertyIds()
List the identifers of properties associated with this transformation. |
IPatternMetatype[] |
getTargetTypes()
Returns the types of elements that are valid targets for an instance of the pattern represented by this pattern descriptor. |
IPatternMetatype |
getType()
Returns the type of element to which an instance of the pattern represented by this pattern descriptor will be bound. |
String |
getVersion()
Returns the version of the pattern represented by this pattern descriptor. |
int |
hashCode()
|
protected void |
initialize()
A hot-spot method that supportspattern definition specific initialization. |
void |
initializeInstance(AbstractPatternInstance instance)
A hot-spot method that supports pattern definition specific initialization of pattern instances. |
boolean |
isGroupMember(String groupPathString)
Determines whether the pattern represented by this pattern descriptor is assigned to the group designated by the given group path string. |
boolean |
isPublic()
Return true if the transformation is public (visible in UI). |
protected boolean |
isValid(EObject targetElement)
Determines if a given target element can be used as the context for instantiating a new pattern instance. |
boolean |
isValidInstanceTarget(Object targetObject)
This method determines if a given target object or context is valid for the instantiation of this pattern definition. |
protected AbstractPatternInstance |
reconstitutePatternInstance(AbstractPatternDefinition owingPatternDefinition,
Object representation)
Reconstitute a pattern instance given a context and a return status object. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected AbstractPatternDefinition(PatternIdentity identity)
identity - the identity of the pattern, used to associate descriptor with
this instance of a pattern definition| Method Detail |
public void accept(Visitor visitor)
accept in interface Visitablepublic int compareTo(Object object)
compareTo in interface Comparable
protected AbstractPatternInstance createPatternInstance(Object targetObject,
AbstractPatternResult results,
MultiStatus status)
targetObject - the target object or context of the instantiationresults - any additional model elements that are created are returned here,
this is an out parameter
public boolean equals(Object object)
public IAdaptable getAdaptableProperty(String propertyId)
IPatternDescriptor
getAdaptableProperty in interface IPatternDescriptorpublic String[] getAssignedGroups()
IPatternDescriptor
getAssignedGroups in interface IPatternDescriptorpublic IPatternMetatype[] getContainerTypes()
IPatternDescriptor
getContainerTypes in interface IPatternDescriptorpublic String getDescription()
ITransformationItem
getDescription in interface ITransformationItempublic String getId()
ITransformationItem
getId in interface ITransformationItempublic IPatternIdentity getIdentity()
IPatternDescriptor
getIdentity in interface IPatternDescriptorpublic String[] getKeywords()
IPatternDescriptor
getKeywords in interface IPatternDescriptorpublic String getName()
ITransformationItem
getName in interface ITransformationItempublic IParameterDescriptor[] getParameters()
IPatternDescriptor
getParameters in interface IPatternDescriptorpublic ITransformationProperty[] getProperties()
ITransformationDescriptor
getProperties in interface ITransformationDescriptorpublic ITransformationProperty getProperty(String propertyId)
ITransformationDescriptor
getProperty in interface ITransformationDescriptorpropertyId - the identifier of the property
public String[] getPropertyIds()
ITransformationDescriptor
getPropertyIds in interface ITransformationDescriptorpublic IPatternMetatype[] getTargetTypes()
IPatternDescriptor
getTargetTypes in interface IPatternDescriptorpublic IPatternMetatype getType()
IPatternDescriptor
getType in interface IPatternDescriptorpublic String getVersion()
IPatternDescriptor
getVersion in interface IPatternDescriptorpublic int hashCode()
protected void initialize()
public void initializeInstance(AbstractPatternInstance instance)
public boolean isGroupMember(String groupPathString)
IPatternDescriptor
isGroupMember in interface IPatternDescriptorgroupPathString - The string for the group path designating
a group for which the pattern represented
by this pattern descriptor will be tested
for membership.
true if the pattern is a member of the group
designated by the given group path string;
otherwise, it returns false.public boolean isPublic()
ITransformationDescriptorThis is a convenience method for returning the value of the PUBLIC property.
isPublic in interface ITransformationDescriptorprotected boolean isValid(EObject targetElement)
targetElement - the target element to be checked for validity
isValid(EObject)public final boolean isValidInstanceTarget(Object targetObject)
targetObject - the target object to be checked, this must be an EObject
isValid(EObject)
protected AbstractPatternInstance reconstitutePatternInstance(AbstractPatternDefinition owingPatternDefinition,
Object representation)
owingPatternDefinition - the governing pattern definition for this instancerepresentation - the persistent store representation of the pattern instance within
the persistent store
|
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.