IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.core
Interface IPatternMetatype

All Superinterfaces:
ITransformationItem
All Known Implementing Classes:
PatternMetatype, PatternMetatype.JavaMetatype

public interface IPatternMetatype
extends ITransformationItem

Represents the type used in a pattern that is from a metamodel.

A pattern metatype is a transformation item. The pattern metatype has a name, a unique identifier, and description attributes. A pattern metatype has an associated metamodel which is identified at least by name (getMetamodelName). If the metamodel is an EMF metamodel, then the EPackage (getMetamodel) representing the metamodel and the EClass (getEClass) defining the type are also provided.

A pattern metatype can be an enumeration whose values are a fixed set of enumeration literals (getEnumerationLiterals). Use the isEnumeration method to check whether the metatype is an enumeration. An enumeration type is typically defined by a pattern library for use by one or more patterns in the library.


Method Summary
 EClass getEClass()
          Returns the EClass representing the metatype, if the associated metamodel is an EMF metamodel.
 IEnumerationLiteral[] getEnumerationLiterals()
          Returns the array of enumeration literals for an enumeration metatype.
 String getImage(Object object)
          Returns the human readable image of the given object.
 EPackage getMetamodel()
          Returns the EPackage that is the root of the package hierarchy containing the EClass of the metatype, if the associated metamodel is an EMF metamodel.
 String getMetamodelName()
          Returns the name of the metamodel of the metatype.
 boolean isAssignableFrom(IPatternMetatype metatype)
          Indicates whether this metatype is either the same as, or a superclass of, the given metatype.
 boolean isEnumeration()
          Indicates whether the metatype is an enumeration.
 boolean isValidValue(Object object)
          Indicates whether the given object is a valid value of the metatype.
 
Methods inherited from interface com.ibm.xtools.transform.core.ITransformationItem
getDescription, getId, getName
 

Method Detail

getMetamodelName

public String getMetamodelName()
Returns the name of the metamodel of the metatype. If the metatype is an enumeration type defined by a pattern library, then the metamodel name is the library name.

Returns:
Returns the name of the metamodel of the metatype.

getEClass

public EClass getEClass()
Returns the EClass representing the metatype, if the associated metamodel is an EMF metamodel.

Returns:
Returns the EClass representing the metatype if the metatype belongs to an EMF metamodel; otherwise, it returns null.

getMetamodel

public EPackage getMetamodel()
Returns the EPackage that is the root of the package hierarchy containing the EClass of the metatype, if the associated metamodel is an EMF metamodel.

Use the getEClass method to retrieve the EClass representing the metatype.

Returns:
Returns the EPackage containing the metatype if the metamodel is an EMF metamodel; otherwise, it returns null.

isEnumeration

public boolean isEnumeration()
Indicates whether the metatype is an enumeration.

The metatype is an enumeration if the values of the type are a fixed set of enumeration literals. Use the getEnumerationLiterals method to retrieve the array of enumeration literals.

Returns:
Returns a value of true if the metatype is an enumeration; otherwise, it returns false.

getEnumerationLiterals

public IEnumerationLiteral[] getEnumerationLiterals()
Returns the array of enumeration literals for an enumeration metatype.

Returns:
Returns the literals of the enumeration metatype. If the metatype is not an enumeration, it returns null.

isAssignableFrom

public boolean isAssignableFrom(IPatternMetatype metatype)

Indicates whether this metatype is either the same as, or a superclass of, the given metatype.

Parameters:
metatype - The object to be tested as a subtype of this metatype.
Returns:
Returns true if this metatype is the same as or as supertype of the given metatype; otherwise, it returns false.

isValidValue

public boolean isValidValue(Object object)
Indicates whether the given object is a valid value of the metatype.

Parameters:
object - The object to be tested as a value of this metatype.
Returns:
Returns true if the object is a valid value of the metatype; otherwise, it returns false.

getImage

public String getImage(Object object)
Returns the human readable image of the given object.

If the object is not a valid value of the metatype the image will be empty.

Parameters:
object - The object for which the image is to be returned.
Returns:
Returns a human readable image of the given object if the object is a valid value of the metatype; otherwise, it returns an empty string.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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