OCL

org.topcased.service.oclchecker.helper
Class OCLServiceHelper

java.lang.Object
  extended by org.topcased.service.oclchecker.helper.OCLServiceHelper

public class OCLServiceHelper
extends java.lang.Object

Helper for common code between checker and statistic services.
Mainly composed by methods accessible by a static way.


Constructor Summary
OCLServiceHelper()
           
 
Method Summary
static org.eclipse.ocl.expressions.OCLExpression<EClassifier> createOCLExpression(java.lang.String mmURI, java.lang.String context, java.lang.String rule)
          Creates an OCL Expression
static org.eclipse.ocl.expressions.OCLExpression<EClassifier> createOCLQuery(java.lang.String mmURI, java.lang.String context, java.lang.String rule)
          Creates an OCL Query
static EClass getContext(java.lang.String mmURI, java.lang.String context)
          Gets the metamodel and looks for the textual context in order to return the corresponding model element.
static EPackage getMetaModelPackage(java.lang.String mmURI)
          Gets the metamodel corresponding to the URI given in parameter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OCLServiceHelper

public OCLServiceHelper()
Method Detail

getMetaModelPackage

public static EPackage getMetaModelPackage(java.lang.String mmURI)
Gets the metamodel corresponding to the URI given in parameter.
The EMF registry is inspected. If the EPackage is not found, the value null is returned..

Parameters:
mmURI - The metamodel of the model
Returns:
The root element of the metamodel

getContext

public static EClass getContext(java.lang.String mmURI,
                                java.lang.String context)
Gets the metamodel and looks for the textual context in order to return the corresponding model element.

Parameters:
mmURI - The metamodel of the model
context - The context of the OCL rule to apply
Returns:
A EClass corresponding to the context in the given metamodel

createOCLExpression

public static org.eclipse.ocl.expressions.OCLExpression<EClassifier> createOCLExpression(java.lang.String mmURI,
                                                                                         java.lang.String context,
                                                                                         java.lang.String rule)
                                                                                  throws org.eclipse.ocl.ParserException
Creates an OCL Expression

Parameters:
mmURI - The metamodel of the model
context - The context of the OCL rule to apply
rule - The OCL rule to execute
Returns:
An OCL expression
Throws:
ModelingServiceError - If an error occured while the creation of the OCLHelper.
org.eclipse.ocl.ParserException

createOCLQuery

public static org.eclipse.ocl.expressions.OCLExpression<EClassifier> createOCLQuery(java.lang.String mmURI,
                                                                                    java.lang.String context,
                                                                                    java.lang.String rule)
                                                                             throws org.eclipse.ocl.ParserException
Creates an OCL Query

Parameters:
mmURI - The metamodel of the model
context - The context of the OCL rule to apply
rule - The OCL rule to execute
Returns:
An OCL expression
Throws:
ModelingServiceError - If an error occured while the creation of the OCLHelper.
org.eclipse.ocl.ParserException

OCL

Copyright (c) 2005 TOPCASED Contributors 2005 - 2007. All rights reserved.