Java API ReferenceClass Hierarchy | All Classes | All Fields and Methods

com.ibm.xtools.patterns.framework

Class AbstractPatternDefinition

+-- 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 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 provided by the pattern service implementation and the pattern definition specializing class needs only to use the superclass constructor with the minimal parameters needed to associate the implementation with the descriptor.
  • For patterns that are dynamically-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.

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
voidaccept(Visitor visitor)

Enables visitation of this entity.

intcompareTo(IPatternDescriptor patternDescriptor)

Compares pattern descriptors.

booleanequals(Object object)

Represents the object to override.

IAdaptablegetAdaptableProperty(String propertyId)

Retrieves the adaptable property of the object.

StringgetAssignedGroups()

Retrieves the assigned group values for the pattern descriptor.

IPatternMetatypegetContainerTypes()

Retrieves the container types for the pattern descriptor.

StringgetDescription()

Retrieves the description of the pattern descriptor value.

URLgetIconURL()

Retrieves the URL object representing the icon URL value.

StringgetId()

Retrieves the Id value of the pattern descriptor.

IPatternIdentitygetIdentity()

Retrieves the IPatternIdentity object representing the identity value.

StringgetImplementationTechnologyID()

Retrieves the implementation technology ID value.

StringgetKeywords()

Retrieves the array of Strings representing the keywords value.

StringgetName()

Retrieves the name value.

IParameterDescriptorgetParameters()

Retrieves the array of IParameterDescriptor objects representing the parameters value.

ITransformationPropertygetProperties()

Retrieves the array of ITransformationProperty objects representing the properties values.

ITransformationPropertygetProperty(String propertyId)

Retrieves the ITransformationProperty object.

StringgetPropertyIds()

Retrieves the array of Strings representing the property ids value.

IPatternMetatypegetTargetTypes()

Retrieves the target type values.

IPatternMetatypegetType()

Retrieves the type value.

StringgetVersion()

Retrieves the version value.

inthashCode()

Retrieves the hash code value.

voidinitializeInstance(AbstractPatternInstance instance)

Represents a hot-spot method that supports pattern definition specific initialization of pattern instances.

booleanisGroupMember(String groupPathString)

Retrieves whether the object is part of the path group.

booleanisPublic()

Retrieves whether the object is public.

booleanisValidInstanceTarget(Object targetObject)

Determines if a given target object or context is valid for the instantiation of this pattern definition.

Constructor detail

AbstractPatternDefinition

public AbstractPatternDefinition()

The default constructor for AbstractPatternDefinition class that is provided automatically by the compiler.


Method detail

accept

public void accept(Visitor visitor)

Enables visitation of this entity.

Parameters:

visitor
- The visitor of the entity.

compareTo

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.

equals

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.

getAdaptableProperty

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.

getAssignedGroups

public String getAssignedGroups()

Retrieves the assigned group values for the pattern descriptor.

Returns:

An array of Strings representing the assigned group values.

getContainerTypes

public IPatternMetatype getContainerTypes()

Retrieves the container types for the pattern descriptor.

Returns:

An array of IPatternMetatype objects representing the container types values.

getDescription

public String getDescription()

Retrieves the description of the pattern descriptor value.

Returns:

A String representing the description value.

getIconURL

public URL getIconURL()

Retrieves the URL object representing the icon URL value.

Returns:

A URL object representing the icon URL value.

getId

public String getId()

Retrieves the Id value of the pattern descriptor.

Returns:

A String representing the Id value.

getIdentity

public IPatternIdentity getIdentity()

Retrieves the IPatternIdentity object representing the identity value.

Returns:

An IPatternIdentity object representing the identity value.

getImplementationTechnologyID

public String getImplementationTechnologyID()

Retrieves the implementation technology ID value.

Returns:

A String representing the implementation technology ID value.

getKeywords

public String getKeywords()

Retrieves the array of Strings representing the keywords value.

Returns:

An array of Strings representing the keywords value.

getName

public String getName()

Retrieves the name value.

Returns:

A String representing the name value.

getParameters

public IParameterDescriptor getParameters()

Retrieves the array of IParameterDescriptor objects representing the parameters value.

Returns:

An array of IParameterDescriptor objects representing the parameters value.

getProperties

public ITransformationProperty getProperties()

Retrieves the array of ITransformationProperty objects representing the properties values.

Returns:

An array of ITransformationProperty objects representing the properties values.

getProperty

public ITransformationProperty getProperty(String propertyId)

Retrieves the ITransformationProperty object.

Parameters:

propertyId
- The property Id of the object.

Returns:

An ITransformationProperty object.

getPropertyIds

public String getPropertyIds()

Retrieves the array of Strings representing the property ids value.

Returns:

An array of Strings representing the property ids value.

getTargetTypes

public IPatternMetatype getTargetTypes()

Retrieves the target type values.

Returns:

An array of IPatternMetatype objects representing the target types value.

getType

public IPatternMetatype getType()

Retrieves the type value.

Returns:

An IPatternMetatype object representing the type value.

getVersion

public String getVersion()

Retrieves the version value.

Returns:

A String representing the version value.

hashCode

public int hashCode()

Retrieves the hash code value.

Returns:

An integer representing the hash code value.

initializeInstance

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.

isGroupMember

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.

isPublic

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.

isValidInstanceTarget

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.


Feedback