EMFT OCL Overview

The OCL framework provides the basic infrastructure for OCL constraint parsing and content assist for user models, OCL constraint validation and specifying OCL queries and conditions. The following are the main classes to be used with this framework:

  1. OCL expressions are used for constructing, validating, and evaluating OCL queries and constraints on EMF model elements. The QueryFactory class will creates instances of the Query class. The syntax of the queries is implemented by the OclExpression class. For walking an OCL expression AST, see the Visitor interface.
  2. The framework provides support for OCL syntax completion and parsing on the meta-model and user model level. The primary interface is the IOclHelper, which provides OCL syntax completion assistance and parsing support. Instances of this interface are obtained from the HelperUtil class. OCL code completion suggestions are represented as Choice instances, which indicate the text of a language construct, a description, and the type of construct (ChoiceType).

Please refer to the tutorial OCL Interpreter Tutorial for reviewing some code samples.


Copyright (c) 2000,2005 IBM Corporation and others. All Rights Reserved.