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

com.ibm.xtools.patterns.framework

Class AbstractPatternLibrary

+-- AbstractPatternInstanceProvider
      +-- AbstractPatternLibrary

abstract public Class AbstractPatternLibrary
extends AbstractPatternInstanceProvider

Represents the abstract base class to all pattern libraries defined by the framework.

This class implements the pattern provider and pattern instance provider interfaces defined by the patterns core plug-in. It provides an implementation for the provides(IOperation) method that demultiplexes the provides call into the more type-specific overloaded provides method.

To override the default provides implementation for any operation, override one of the type-specific provides methods. The general provides method has been made final as a reminder to make changes in the type-specific overloaded provides methods only.

The hot-spot method that must be overridden is the get available pattern definitions method; the return results from this method define what patterns are available for use during this library run-time existence.

The create framework configuration method is a hot-spot method that can be optionally overridden. This is a factory method that returns the configuration that should be in use for this particular library.

There are less frequently overridden hot-spot methods that can be optionally overridden. These methods include the provides methods strongly-typed to a particular operation.


Method summary
voidaccept(Visitor visitor)

Enables visitation of this entity.

voidaddProviderChangeListener(IProviderChangeListener listener)

Adds provider change listener.

AbstractPatternInstancecreateContainedPatternInstance(IPatternDescriptor pattern, Object container, PatternInstanceOption options, AbstractPatternResult results, MultiStatus status)

Generates the contained pattern instance.

AbstractPatternInstancecreatePatternInstance(IPatternDescriptor pattern, IParameterDescriptor parameter, Object targetObject, PatternInstanceOption options, AbstractPatternResult results, MultiStatus status)

Generates the pattern instance.

AbstractPatternInstancecreatePatternInstance(IPatternDescriptor pattern, Object targetObject, PatternInstanceOption options, AbstractPatternResult results, MultiStatus status)

Generates the pattern instance.

URLfindImage(String imagePathIdentifier)

Finds an URL pointing to an image for the given image path identifier.

AbstractPatternInstancegetAppliedPatternInstance(IPatternApplication pattern, EObject applicationObject, MultiStatus status)

Retrieves the applied pattern instance.

IPatternApplicationgetAppliedPatterns(EObject context, MultiStatus status)

Retrieves the applied pattern.

booleanisPatternDefinitionAvailable(String identifier)

Determines if a pattern definition is available given the unique identifier specified.

booleanprovides(IOperation operation)

Indicates whether this pattern library provides the given operation as defined by the pattern service.

voidremoveProviderChangeListener(IProviderChangeListener listener)

Removes the provider listener.

Method detail

accept

public void accept(Visitor visitor)

Enables visitation of this entity.

Parameters:

visitor
- The visitor of the entity.

addProviderChangeListener

public void addProviderChangeListener(IProviderChangeListener listener)

Adds provider change listener.

Parameters:

listener
- The listener for the provider.

createContainedPatternInstance

public AbstractPatternInstance createContainedPatternInstance(IPatternDescriptor pattern, Object container, PatternInstanceOption options, AbstractPatternResult results, MultiStatus status)

Generates the contained pattern instance.

Parameters:

pattern
- The pattern to use.
container
- The container for the pattern instance.
options
- The options for the pattern instance.
results
- The results of the operation.
status
- The status of the operation.

Returns:

An AbstractPatternInstance object.

createPatternInstance

public AbstractPatternInstance createPatternInstance(IPatternDescriptor pattern, IParameterDescriptor parameter, Object targetObject, PatternInstanceOption options, AbstractPatternResult results, MultiStatus status)

Generates the pattern instance.

Parameters:

pattern
- The pattern to use.
parameter
- The parameter for the pattern instance.
targetObject
- The object to be bound.
options
- The options for the parameter type.
results
- The results of the operation.
status
- The status of the operation.

Returns:

An AbstractPatternInstance object.

createPatternInstance

public AbstractPatternInstance createPatternInstance(IPatternDescriptor pattern, Object targetObject, PatternInstanceOption options, AbstractPatternResult results, MultiStatus status)

Generates the pattern instance.

Parameters:

pattern
- The pattern to use.
targetObject
- The object to be bound.
options
- The options for the parameter type.
results
- The results of the operation.
status
- The status of the operation.

Returns:

An AbstractPatternInstance object.

findImage

final public URL findImage(String imagePathIdentifier)

Finds an URL pointing to an image for the given image path identifier.

The image path identifier is a relative path identifier. The following can be a valid path: "images/StrategyPattern2.gif -- the $nl$/icons/". It is prepended as the result of the contained methods being executed.

Parameters:

imagePathIdentifier
- The relative image path identifier.

Returns:

The URL pointing to the image within the icon directory.

getAppliedPatternInstance

public AbstractPatternInstance getAppliedPatternInstance(IPatternApplication pattern, EObject applicationObject, MultiStatus status)

Retrieves the applied pattern instance.

Parameters:

pattern
- The pattern to use.
applicationObject
- The application object.
status
- The status of the operation.

Returns:

An AbstractPatternInstance object.

getAppliedPatterns

final public IPatternApplication getAppliedPatterns(EObject context, MultiStatus status)

Retrieves the applied pattern.

Parameters:

context
- The available context.
status
- The status of the operation.

Returns:

An array of IPatternApplication objects.

isPatternDefinitionAvailable

final public boolean isPatternDefinitionAvailable(String identifier)

Determines if a pattern definition is available given the unique identifier specified.

Parameters:

identifier
- The unique identifier of the pattern definition of interest.

Returns:

A boolean value of true if the pattern definition is available and returned through the get available pattern definitions method in this library. Otherwise, it returns a value of false.

provides

public boolean provides(IOperation operation)

Indicates whether this pattern library provides the given operation as defined by the pattern service.

Parameters:

operation
- The operation checked to see if provided.

Returns:

A boolean value of true if this pattern library supports the operation. Otherwise, it returns a value of false.

removeProviderChangeListener

public void removeProviderChangeListener(IProviderChangeListener listener)

Removes the provider listener.

Parameters:

listener
- The listener for the provider.


Feedback