UML Modeling Layer

com.ibm.xtools.uml.msl.internal.lang
Class DerivedLanguageDescriptor

java.lang.Object
  extended by com.ibm.xtools.uml.msl.lang.AbstractLanguageDescriptor
      extended by com.ibm.xtools.uml.msl.internal.lang.DerivedLanguageDescriptor
All Implemented Interfaces:
IUMLDerivedLanguageDescriptor, IUMLLanguageDescriptor
Direct Known Subclasses:
FirstLanguageDescriptor, ModelLanguageDescriptor

public abstract class DerivedLanguageDescriptor
extends AbstractLanguageDescriptor
implements IUMLDerivedLanguageDescriptor

Base implementation for specialized language descriptors that really only provide a facade for another descriptor.


Constructor Summary
protected DerivedLanguageDescriptor(String name)
          Singleton
 
Method Summary
 boolean equals(Object o)
           
protected abstract  String extractLanguageID(LanguageContext context)
          This type of descriptor is specialized to determine its language from a context element.
 IUMLLanguageDescriptor getDelegateDescriptor()
           
 Collection<String> getLanguageActivityIDs()
          
 String getLanguageExtension()
          
 String getLanguageID()
          
 Collection<URI> getLanguageLibraryURIs()
          
 Collection<PrimitiveType> getPrimitiveTypes(ResourceSet set)
          Gets the primitive types associated with this language.
 Collection<URI> getProfileURIs()
          
 boolean initializeBasedOnContext(LanguageContext context)
          If this descriptor is dependent on the language context, than this method should be implemented to initialize itself based on the context change.
protected  void setDelegateDescriptor(IUMLLanguageDescriptor desc)
           
 
Methods inherited from class com.ibm.xtools.uml.msl.lang.AbstractLanguageDescriptor
getDisplayName, getLibrary, getPrimitiveTypeLibraryNames
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.ibm.xtools.uml.msl.internal.lang.IUMLDerivedLanguageDescriptor
getID
 
Methods inherited from interface com.ibm.xtools.uml.msl.lang.IUMLLanguageDescriptor
getDisplayName
 

Constructor Detail

DerivedLanguageDescriptor

protected DerivedLanguageDescriptor(String name)
Singleton

Method Detail

getDelegateDescriptor

public IUMLLanguageDescriptor getDelegateDescriptor()
Returns:
the delegate

setDelegateDescriptor

protected void setDelegateDescriptor(IUMLLanguageDescriptor desc)

getLanguageActivityIDs

public Collection<String> getLanguageActivityIDs()
Description copied from class: AbstractLanguageDescriptor

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

getLanguageID

public String getLanguageID()
Description copied from class: AbstractLanguageDescriptor

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

getLanguageExtension

public String getLanguageExtension()
Description copied from class: AbstractLanguageDescriptor

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

getProfileURIs

public Collection<URI> getProfileURIs()
Description copied from class: AbstractLanguageDescriptor

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

getLanguageLibraryURIs

public Collection<URI> getLanguageLibraryURIs()
Description copied from class: AbstractLanguageDescriptor

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

getPrimitiveTypes

public Collection<PrimitiveType> getPrimitiveTypes(ResourceSet set)
Description copied from class: AbstractLanguageDescriptor
Gets the primitive types associated with this language.

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

equals

public boolean equals(Object o)
Overrides:
equals in class Object

initializeBasedOnContext

public boolean initializeBasedOnContext(LanguageContext context)
Description copied from interface: IUMLDerivedLanguageDescriptor
If this descriptor is dependent on the language context, than this method should be implemented to initialize itself based on the context change. Static language implementations of a IUMLLanguageDescriptor will not require the handling of this method.

Specified by:
initializeBasedOnContext in interface IUMLDerivedLanguageDescriptor
Parameters:
context - The new context to initialize with Note: Implementors should expect this to be possibly null
Returns:
true if this descriptor changed because of the context. false otherwise

extractLanguageID

protected abstract String extractLanguageID(LanguageContext context)
This type of descriptor is specialized to determine its language from a context element. This API is used to allow the descriptor to extract the language from the context.

Parameters:
context - The language context element. Note: Implementors should expect this to be possibly null
Returns:
The String language ID to use for the given context with respect to this descriptor. Or null if no language could be found.

UML Modeling Layer

© Copyright IBM Corp. 2009. All rights reserved.