IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework
Class PatternParameterUsage

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.PatternParameterUsage
All Implemented Interfaces:
Comparable, IParameterDescriptor, ITransformationDescriptor, ITransformationItem

public class PatternParameterUsage
extends Object
implements IParameterDescriptor

A pattern parameter usage is used to wrap the use of a pattern parameter from other parts within the framework. This typically means that a parameter descriptor or some related information on that parameter descriptor needs to be proxified so that the parameter descriptor is resolved only after the first time it is needed. This is done not for performance reasons but for the reason of eliminating re-entrant calls into the constructor of the particular abstract pattern library being initialized when the first pattern service interrogation calls come in to the framework. There is an equivalent of this class for pattern definitions that is used for the same purpose (as well as being used for nested pattern instances).


Field Summary
 
Fields inherited from interface com.ibm.xtools.patterns.core.IParameterDescriptor
BINDABLE
 
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
 
Method Summary
 int compareTo(Object o)
           
 IPatternMetatype[] getAlternateTypes()
          Retrieves the alternate types that are accepted for the arguments of the parameter represented by this descriptor.
 String getDescription()
          Retrieve the localized description of the transformation item.
 String getId()
          Retrieve the unique id of the transformation item.
 IMultiplicity getMultiplicity()
          Retrieves the multiplicity of the parameter represented by this descriptor.
 String getName()
          Retrieve the localized name of the transformation item.
 int getOrdinal()
           Retrieves the ordinal of the parameter in the list of parameters for the pattern.
 IPatternIdentity getPatternIdentity()
          Retrieves the composite identity of the pattern that has the parameter represented by this 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 getType()
          Retrieves the type of the parameter represented by this descriptor.
 boolean isBindable()
          Retrieves whether the parameter represented by this descriptor is available for binding with an argument or arguments.
 boolean isPublic()
          Return true if the transformation is public (visible in UI).
 boolean isValidArgumentType(IPatternMetatype metatype)
          Checks whether the object of the given metatype is accepted as an argument of the parameter represented by this descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getAlternateTypes

public IPatternMetatype[] getAlternateTypes()
Description copied from interface: IParameterDescriptor

Retrieves the alternate types that are accepted for the arguments of the parameter represented by this descriptor.

Specified by:
getAlternateTypes in interface IParameterDescriptor
Returns:
Returns the alternate types accepted for the arguments of the parameter.

getDescription

public String getDescription()
Description copied from interface: ITransformationItem
Retrieve the localized description of the transformation item.

Specified by:
getDescription in interface ITransformationItem
Returns:
String - the localized description for the transformation item.

getId

public String getId()
Description copied from interface: ITransformationItem
Retrieve the unique id of the transformation item.

Specified by:
getId in interface ITransformationItem
Returns:
String - the unique identifier for the transformation item

getMultiplicity

public IMultiplicity getMultiplicity()
Description copied from interface: IParameterDescriptor

Retrieves the multiplicity of the parameter represented by this descriptor.

Multiplicity represents the range of the allowable cardinality values that a set can assume.

Specified by:
getMultiplicity in interface IParameterDescriptor
Returns:
Returns the multiplicity of the parameter.

getName

public String getName()
Description copied from interface: ITransformationItem
Retrieve the localized name of the transformation item.

Specified by:
getName in interface ITransformationItem
Returns:
String - the localized name for the transformation item.

getOrdinal

public int getOrdinal()
Description copied from interface: IParameterDescriptor

Retrieves the ordinal of the parameter in the list of parameters for the pattern.

Specified by:
getOrdinal in interface IParameterDescriptor
Returns:
Returns the ordinal of the parameter.

getPatternIdentity

public IPatternIdentity getPatternIdentity()
Description copied from interface: IParameterDescriptor

Retrieves the composite identity of the pattern that has the parameter represented by this descriptor.

The composite unique identity of a pattern is represented by a pattern descriptor. The components of the identity are the id (getPatternId) and the version of the pattern (getPatternVersion).

Specified by:
getPatternIdentity in interface IParameterDescriptor
Returns:
Returns the identity of the pattern that has the parameter represented by this descriptor.

getProperties

public ITransformationProperty[] getProperties()
Description copied from interface: ITransformationDescriptor
Return all defined properties associated with this transformation. This method returns all of the static properties defined for this transformation, including readonly properties. Properties defined in a transform context (@link ITransformContext) are not returned by this method. Each associated property defines the default value, which cannot be changed. However the values for non-readonly properties can be overridden in the transform context.

Specified by:
getProperties in interface ITransformationDescriptor
Returns:
TransformationProperty[] - an array of defined properties

getProperty

public ITransformationProperty getProperty(String propertyId)
Description copied from interface: ITransformationDescriptor
Return the specified property associated with this transformation. If the property is not defeind for this transformation, null is returned.

Specified by:
getProperty in interface ITransformationDescriptor
Parameters:
propertyId - the identifier of the property
Returns:
ITransformationProperty - the property, if defined

getPropertyIds

public String[] getPropertyIds()
Description copied from interface: ITransformationDescriptor
List the identifers of properties associated with this transformation. This list contains only those properties that have been defined and does not include any new properties defined in a transform context (@link ITransformContext).

Specified by:
getPropertyIds in interface ITransformationDescriptor
Returns:
String[] - the identifiers of associated properties

getType

public IPatternMetatype getType()
Description copied from interface: IParameterDescriptor

Retrieves the type of the parameter represented by this descriptor.

Use the Pair method to retrieve the argument pairs used as parameter arguments. Use the isValidArgumentType method to retrieve whether the object of a specific metatype is accepted as an argument of the parameter. Use the getAlternateTypes method to retrieve the types accepted for parameter arguments.

Specified by:
getType in interface IParameterDescriptor
Returns:
Returns the type of the parameter.

isBindable

public boolean isBindable()
Description copied from interface: IParameterDescriptor

Retrieves whether the parameter represented by this descriptor is available for binding with an argument or arguments.

A binding is a relationship connection between a template and a model element generated from the template. It provides the collection of the arguments that instantiate the template parameters. A binding is associated with one template. Each binding generates one model element. The generated model element must be fully specified by the arguments supplied to the binding.

Note: In general, if a parameter is not bindable, it should not be exposed to a user.

Specified by:
isBindable in interface IParameterDescriptor
Returns:
Returns a Boolean that has a value of True if the parameter is bindable. Otherwise, it returns a value of False.

isPublic

public boolean isPublic()
Description copied from interface: ITransformationDescriptor
Return true if the transformation is public (visible in UI).

This is a convenience method for returning the value of the PUBLIC property.

Specified by:
isPublic in interface ITransformationDescriptor
Returns:
boolean - true for public transformations

isValidArgumentType

public boolean isValidArgumentType(IPatternMetatype metatype)
Description copied from interface: IParameterDescriptor

Checks whether the object of the given metatype is accepted as an argument of the parameter represented by this descriptor.

Use the getAlternateTypes method to retrieve the types accepted for parameter arguments.

Specified by:
isValidArgumentType in interface IParameterDescriptor
Returns:
Returns a Boolean value of True if the object of the given metatype can be an argument for the parameter. Otherwise, it returns a value of False.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

Copyright (c) IBM Corp. and others 2004. All rights reserved.