| Java API Reference | Class Hierarchy | All Classes | All Fields and Methods |
com.ibm.xtools.patterns.framework
+-- AbstractPatternElement +-- AbstractPatternDefinition
abstract public Class AbstractPatternDefinition
extends AbstractPatternElement
Represents 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, it will have a descriptor found in the plugin.xml file of the pattern library 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 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.
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 valid method that determines if a pattern instantiation of this pattern definition type can occur given a certain context.
| Constructor summary |
|---|
| AbstractPatternDefinition() The default constructor for AbstractPatternDefinition class that is provided automatically by the compiler. |
| Method summary | |
|---|---|
| void | accept(Visitor visitor) Enables visitation of this entity. |
| int | compareTo(IPatternDescriptor patternDescriptor) Compares pattern descriptors. |
| boolean | equals(Object object) Represents the object to override. |
| IAdaptable | getAdaptableProperty(String propertyId) Retrieves the adaptable property of the object. |
| String | getAssignedGroups() Retrieves the assigned group values for the pattern descriptor. |
| IPatternMetatype | getContainerTypes() Retrieves the container types for the pattern descriptor. |
| String | getDescription() Retrieves the description of the pattern descriptor value. |
| URL | getIconURL() Retrieves the URL object representing the icon URL value. |
| String | getId() Retrieves the Id value of the pattern descriptor. |
| IPatternIdentity | getIdentity() Retrieves the IPatternIdentity object representing the identity value. |
| String | getImplementationTechnologyID() Retrieves the implementation technology ID value. |
| String | getKeywords() Retrieves the array of Strings representing the keywords value. |
| String | getName() Retrieves the name value. |
| IParameterDescriptor | getParameters() Retrieves the array of IParameterDescriptor objects representing the parameters value. |
| ITransformationProperty | getProperties() Retrieves the array of ITransformationProperty objects representing the properties values. |
| ITransformationProperty | getProperty(String propertyId) Retrieves the ITransformationProperty object. |
| String | getPropertyIds() Retrieves the array of Strings representing the property ids value. |
| IPatternMetatype | getTargetTypes() Retrieves the target type values. |
| IPatternMetatype | getType() Retrieves the type value. |
| String | getVersion() Retrieves the version value. |
| int | hashCode() Retrieves the hash code value. |
| void | initializeInstance(AbstractPatternInstance instance) Represents a hot-spot method that supports pattern definition specific initialization of pattern instances. |
| boolean | isGroupMember(String groupPathString) Retrieves whether the object is part of the path group. |
| boolean | isPublic() Retrieves whether the object is public. |
| boolean | isValidInstanceTarget(Object targetObject) Determines if a given target object or context is valid for the instantiation of this pattern definition. |
Constructor detail
public AbstractPatternDefinition()
The default constructor for AbstractPatternDefinition class that is provided automatically by the compiler.
Method detail
public void accept(Visitor visitor)
Enables visitation of this entity.
Parameters:
| visitor | - The visitor of the entity. |
public int compareTo(IPatternDescriptor patternDescriptor)
Compares pattern descriptors.
Parameters:
| patternDescriptor | - The descriptor of the parameter to compare. |
Returns:
An integer representing the value of the compared pattern descriptor. |
public boolean equals(Object object)
Represents the object to override.
Parameters:
| object | - The object to override. |
Returns:
A boolean value of true if the the object was overridden. Otherwise, it returns a value of false. |
public IAdaptable getAdaptableProperty(String propertyId)
Retrieves the adaptable property of the object.
Parameters:
| propertyId | - The Id of the adaptable property to retrieve. |
Returns:
An IAdaptable object. |
public String getAssignedGroups()
Retrieves the assigned group values for the pattern descriptor.
Returns:
An array of Strings representing the assigned group values. |
public IPatternMetatype getContainerTypes()
Retrieves the container types for the pattern descriptor.
Returns:
An array of IPatternMetatype objects representing the container types values. |
public String getDescription()
Retrieves the description of the pattern descriptor value.
Returns:
A String representing the description value. |
public URL getIconURL()
Retrieves the URL object representing the icon URL value.
Returns:
A URL object representing the icon URL value. |
public String getId()
Retrieves the Id value of the pattern descriptor.
Returns:
A String representing the Id value. |
public IPatternIdentity getIdentity()
Retrieves the IPatternIdentity object representing the identity value.
Returns:
An IPatternIdentity object representing the identity value. |
public String getImplementationTechnologyID()
Retrieves the implementation technology ID value.
Returns:
A String representing the implementation technology ID value. |
public String getKeywords()
Retrieves the array of Strings representing the keywords value.
Returns:
An array of Strings representing the keywords value. |
public String getName()
Retrieves the name value.
Returns:
A String representing the name value. |
public IParameterDescriptor getParameters()
Retrieves the array of IParameterDescriptor objects representing the parameters value.
Returns:
An array of IParameterDescriptor objects representing the parameters value. |
public ITransformationProperty getProperties()
Retrieves the array of ITransformationProperty objects representing the properties values.
Returns:
An array of ITransformationProperty objects representing the properties values. |
public ITransformationProperty getProperty(String propertyId)
Retrieves the ITransformationProperty object.
Parameters:
| propertyId | - The property Id of the object. |
Returns:
An ITransformationProperty object. |
public String getPropertyIds()
Retrieves the array of Strings representing the property ids value.
Returns:
An array of Strings representing the property ids value. |
public IPatternMetatype getTargetTypes()
Retrieves the target type values.
Returns:
An array of IPatternMetatype objects representing the target types value. |
public IPatternMetatype getType()
Retrieves the type value.
Returns:
An IPatternMetatype object representing the type value. |
public String getVersion()
Retrieves the version value.
Returns:
A String representing the version value. |
public int hashCode()
Retrieves the hash code value.
Returns:
An integer representing the hash code value. |
public void initializeInstance(AbstractPatternInstance instance)
Represents a hot-spot method that supports pattern definition specific initialization of pattern instances.
This method is invoked from the constructor of a pattern instance. The default implementation is to invoke the initialize() method of the instance.
Parameters:
| instance | - The pattern instance. |
public boolean isGroupMember(String groupPathString)
Retrieves whether the object is part of the path group.
Parameters:
| groupPathString | - The string for the path of the group. |
Returns:
A boolean value of true if the the object is part of the group. Otherwise, it returns a value of false. |
public boolean isPublic()
Retrieves whether the object is public.
Returns:
A boolean value of true if the object is public. Otherwise, it returns a value of false. |
final public boolean isValidInstanceTarget(Object targetObject)
Determines if a given target object or context is valid for the instantiation of this pattern definition.
Currently this involves checking the types stored in the target metatypes instance variable array. For example, a pattern might specify that it is legal for UML2 classes and UML2 packages to be the target object or context in a pattern instance creation.
Parameters:
| targetObject | - The target object to be checked. The target object must be an EObject. |
Returns:
A boolean value of true if the target object is valid for an instantiation of this pattern. Otherwise, it returns a value of false. |