org.ocltf
Class ExpressionTranslator

java.lang.Object
  extended byorg.ocltf.ExpressionTranslator

public class ExpressionTranslator
extends java.lang.Object

The "OCL" translator class that all translations are performed through. This is the entry point to the framework.

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.Object contextElement, java.lang.String expression)
          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.Object contextElement,
                            java.lang.String expression)
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.
contextElement - the element which provides the context of this expression. This is passed from the model.
expression - the actual expression to translate.
Returns:
Expression the resulting expression instance which contains the translated expression as well as additional information about the expression.


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.