IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework
Class PatternMetatype

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.PatternMetatype
All Implemented Interfaces:
IPatternMetatype, ITransformationItem
Direct Known Subclasses:
PatternMetatype

public class PatternMetatype
extends Object
implements IPatternMetatype

This abstract class is the common implementation for a pattern metatype that represents an EClass in an EMF metamodel.


Field Summary
protected  EClass metaClass
          The EClass metatype for this type
 
Constructor Summary
PatternMetatype(EClass type)
          Constructs a pattern metatype given an EClass to represent the element type.
 
Method Summary
 boolean equals(Object object)
           
 String getDescription()
          Retrieve the localized description of the transformation item.
 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 getId()
          Retrieve the unique id of the transformation item.
 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.
 String getName()
          Retrieve the localized name of the transformation item.
 int hashCode()
           
 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.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

metaClass

protected final EClass metaClass
The EClass metatype for this type

Constructor Detail

PatternMetatype

public PatternMetatype(EClass type)
Constructs a pattern metatype given an EClass to represent the element type.

Parameters:
type - the EClass for the element type
Method Detail

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

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.

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.

getMetamodelName

public String getMetamodelName()
Description copied from interface: IPatternMetatype
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.

Specified by:
getMetamodelName in interface IPatternMetatype
Returns:
Returns the name of the metamodel of the metatype.

getEClass

public EClass getEClass()
Description copied from interface: IPatternMetatype
Returns the EClass representing the metatype, if the associated metamodel is an EMF metamodel.

Specified by:
getEClass in interface IPatternMetatype
Returns:
Returns the EClass representing the metatype if the metatype belongs to an EMF metamodel; otherwise, it returns null.

getMetamodel

public EPackage getMetamodel()
Description copied from interface: IPatternMetatype
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.

Specified by:
getMetamodel in interface IPatternMetatype
Returns:
Returns the EPackage containing the metatype if the metamodel is an EMF metamodel; otherwise, it returns null.

isEnumeration

public boolean isEnumeration()
Description copied from interface: IPatternMetatype
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.

Specified by:
isEnumeration in interface IPatternMetatype
Returns:
Returns a value of true if the metatype is an enumeration; otherwise, it returns false.

getEnumerationLiterals

public IEnumerationLiteral[] getEnumerationLiterals()
Description copied from interface: IPatternMetatype
Returns the array of enumeration literals for an enumeration metatype.

Specified by:
getEnumerationLiterals in interface IPatternMetatype
Returns:
Returns the literals of the enumeration metatype. If the metatype is not an enumeration, it returns null.

isAssignableFrom

public boolean isAssignableFrom(IPatternMetatype metatype)
Description copied from interface: IPatternMetatype

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

Specified by:
isAssignableFrom in interface IPatternMetatype
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)
Description copied from interface: IPatternMetatype
Indicates whether the given object is a valid value of the metatype.

Specified by:
isValidValue in interface IPatternMetatype
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)
Description copied from interface: IPatternMetatype
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.

Specified by:
getImage in interface IPatternMetatype
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.

equals

public boolean equals(Object object)

hashCode

public int hashCode()

toString

public String toString()

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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