org.andromda.core.translation
Class ExpressionTranslator

java.lang.Object
  extended by org.andromda.core.translation.ExpressionTranslator

public class ExpressionTranslator
extends java.lang.Object

The expression translator class that all translations are performed through. This is the entry point to expression (OCL, etc) translation.

Author:
Chad Brandon

Constructor Summary
ExpressionTranslator()
           
 
Method Summary
 void initialize()
          Initializes the ExpressionTranslator.
static ExpressionTranslator instance()
          Gets the shared ExpressionTranslator instance.
 Expression translate(java.lang.String translationName, java.lang.String expression, java.lang.Object contextElement)
          Performs translation of the expression by looking up the translationName from the available Translation-Libraries found on the classpath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionTranslator

public ExpressionTranslator()
Method Detail

instance

public static ExpressionTranslator instance()
Gets the shared ExpressionTranslator instance.

Returns:
ExpressionTranslator.

initialize

public void initialize()
Initializes the ExpressionTranslator. This MUST be called to find and loal all available translation-libraries.


translate

public Expression translate(java.lang.String translationName,
                            java.lang.String expression,
                            java.lang.Object contextElement)
Performs translation of the expression by looking up the translationName from the available Translation-Libraries found on the classpath.

Parameters:
translationName - the name of the translation to use for translating (i.e. a translationName like 'query.EJB-QL' would mean use the EJB-QL translation from the query library.
expression - the actual expression to translate.
contextElement - the element which provides the context of this expression. This is passed from the model. This can be null.
Returns:
Expression the resulting expression instance which contains the translated expression as well as additional information about the expression.


Copyright © 2003-2008 AndroMDA.org. All Rights Reserved.