IBM Rational Software Modeler
Release 6.0

com.ibm.xtools.patterns.framework.java
Class PatternMetatype.JavaMetatype

java.lang.Object
  extended bycom.ibm.xtools.patterns.framework.java.PatternMetatype.JavaMetatype
All Implemented Interfaces:
IPatternMetatype, ITransformationItem
Enclosing class:
PatternMetatype

public final class PatternMetatype.JavaMetatype
extends Object
implements IPatternMetatype

This class is the common implementation for a pattern metatype that represents a java class.


Field Summary
protected  Class javaClazz
          The java class for this metatype
 
Constructor Summary
PatternMetatype.JavaMetatype(Class clazz)
          Constructs a java metatype for the given java class.
PatternMetatype.JavaMetatype(String className)
          Constructs a java metatype for the java class with the given class name, for example, 'java.lang.String'.
 
Method Summary
 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.
 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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

javaClazz

protected final Class javaClazz
The java class for this metatype

Constructor Detail

PatternMetatype.JavaMetatype

public PatternMetatype.JavaMetatype(String className)
                             throws ClassNotFoundException
Constructs a java metatype for the java class with the given class name, for example, 'java.lang.String'.


PatternMetatype.JavaMetatype

public PatternMetatype.JavaMetatype(Class clazz)
Constructs a java metatype for the given java class.

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.

IBM Rational Software Modeler
Release 6.0


Guidelines for using Eclipse APIs.

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