View Javadoc

1   package org.ocltf.translation;
2   
3   
4   /***
5    * Provides OCL translation capabilities.  Every
6    * OCL translator must implement this interface.
7    * 
8    * @author Chad Brandon
9    */
10  public interface Translator {
11  	
12  	/***
13  	 * This is the name of the element "constrained" by the OCL
14  	 * expression which is made available to the TemplateEngine context.
15  	 * (in other words, it will be made available as an scripting element
16  	 *  on a template processed by the TemplateEngine implementation)
17  	 */
18  	public static final String CONTEXT_ELEMENT = "element";
19  	
20  	/***
21  	 * Translates the OCL into a translated Expression instance.
22  	 * 
23  	 * @param translationLibrary the library and translation to lookup perform
24  	 *        the translation (i.e. sql.Oracle9i --> library to use would be "sql"
25  	 *        and translation from the sql library would be 'Oracle9i').
26  	 * @param contextModelElement the element in the  model to which
27  	 *        the OCL constraint applies. 
28  	 * @param oclExpression the OCL expression to translate.
29  	 * 
30  	 * @return Expression
31       * 
32       * @see org.ocltf.translation.Expression
33  	 */
34  	public Expression translate(
35  		String translationLibrary, 
36  		Object contextModelElement, 
37  		String oclExpression);
38  }