UML Modeling Layer

com.ibm.xtools.uml.msl.lang
Class AbstractLanguageDescriptor

java.lang.Object
  extended by com.ibm.xtools.uml.msl.lang.AbstractLanguageDescriptor
All Implemented Interfaces:
IUMLLanguageDescriptor
Direct Known Subclasses:
AnalysisLanguageDescriptor, CustomLanguageDescriptor, DerivedLanguageDescriptor, OCLLanguageDescriptor

public abstract class AbstractLanguageDescriptor
extends Object
implements IUMLLanguageDescriptor

This is the base implementation for an IUMLLanguageDescriptor.


Constructor Summary
protected AbstractLanguageDescriptor(String langId, String name)
          Constructor for a given language.
protected AbstractLanguageDescriptor(String langId, String name, String extension)
          Constructor when the language extension is known.
 
Method Summary
 String getDisplayName()
          The display name is unchangeable.
 Collection<String> getLanguageActivityIDs()
          
 String getLanguageExtension()
          
 String getLanguageID()
          
 Collection<URI> getLanguageLibraryURIs()
          
protected  Package getLibrary(ResourceSet resourceSet, String name)
          Gets the library with the specified name.
protected  Collection<String> getPrimitiveTypeLibraryNames()
          The names of the primitive type libraries (Packages) that contain the specialized primitive types.
 Collection<PrimitiveType> getPrimitiveTypes(ResourceSet set)
          Gets the primitive types associated with this language.
 Collection<URI> getProfileURIs()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLanguageDescriptor

protected AbstractLanguageDescriptor(String langId,
                                     String name)
Constructor for a given language. Note if an extension is not supplied "txt" will be used

Parameters:
langId - The unique language id to be used when storing a language in the model (Must not be null)
name - A user readable display name if extra description is necessary (Must not be null)

AbstractLanguageDescriptor

protected AbstractLanguageDescriptor(String langId,
                                     String name,
                                     String extension)
Constructor when the language extension is known.

Parameters:
langId - The unique language id to be used when storing a language in the model (Must not be null)
name - A user readable display name if extra description is necessary (Must not be null)
extension - The file extension typically associated with this language
Method Detail

getLanguageID

public String getLanguageID()

Specified by:
getLanguageID in interface IUMLLanguageDescriptor
Returns:
the language identifier for this particular language to be used within the model

getLanguageExtension

public String getLanguageExtension()

Specified by:
getLanguageExtension in interface IUMLLanguageDescriptor
Returns:
a language extension (e.g. txt) that would be commonly associated with the language

getDisplayName

public final String getDisplayName()
The display name is unchangeable.

Specified by:
getDisplayName in interface IUMLLanguageDescriptor
Returns:
The user readable display name

getLanguageActivityIDs

public Collection<String> getLanguageActivityIDs()

Specified by:
getLanguageActivityIDs in interface IUMLLanguageDescriptor
Returns:
the Collection of activity ID's that enable language specified actions / UI in the workbench.

getLanguageLibraryURIs

public Collection<URI> getLanguageLibraryURIs()

Specified by:
getLanguageLibraryURIs in interface IUMLLanguageDescriptor
Returns:
the Collection of URI's that point to library models that are required for this particular language.

getProfileURIs

public Collection<URI> getProfileURIs()

Specified by:
getProfileURIs in interface IUMLLanguageDescriptor
Returns:
the Collection of URI's that point to profiles that are required for this particular language.

getPrimitiveTypes

public Collection<PrimitiveType> getPrimitiveTypes(ResourceSet set)
Gets the primitive types associated with this language.

Specified by:
getPrimitiveTypes in interface IUMLLanguageDescriptor
Parameters:
set - the resource set to use as context
Returns:

getPrimitiveTypeLibraryNames

protected Collection<String> getPrimitiveTypeLibraryNames()
The names of the primitive type libraries (Packages) that contain the specialized primitive types.

Returns:
the names of packages containing specialized primitive types or an empty set.
See Also:
AbstractLanguageDescriptor.getPrimitiveTypes(ResourceSet)

getLibrary

protected Package getLibrary(ResourceSet resourceSet,
                             String name)
Gets the library with the specified name.

Returns:
the Package that is the root of the model library. or null if not found.

UML Modeling Layer

© Copyright IBM Corp. 2009. All rights reserved.