OCL

org.topcased.checkresultmodel.helper
Class CheckResultModelHelper

java.lang.Object
  extended by org.topcased.checkresultmodel.helper.CheckResultModelHelper

public class CheckResultModelHelper
extends java.lang.Object

Helper class proposing a set of convenient static methods to easily handle CheckResultModel.


Constructor Summary
CheckResultModelHelper()
           
 
Method Summary
static void createAcceptedItems(Rule rule, java.util.List<?> acceptedItems)
          Creates a list of the accepted items concerning a rule.
static Model createCheckResulModel(EObject model, EPackage package_, EClass context, java.lang.String rule)
          Creates a default Topcased CheckResultModel
static Context createContext(Package package_, EClass context)
          Creates a Context and adds it to the current Package
static Package createPackage(Model model, EPackage ePackage)
          Creates a Package and adds it to the Check Result Model
static void createRejectedItems(Rule rule, java.util.List<?> acceptedItems)
          Creates a list of the rejected items concerning a rule.
static Rule createRule(Context context, java.lang.String rule)
          Creates a Rule and adds it to the current context
static Rule getFirstRule(Model checkResultModel)
          Gets the first Rule found into a given CheckResultModel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CheckResultModelHelper

public CheckResultModelHelper()
Method Detail

createCheckResulModel

public static Model createCheckResulModel(EObject model,
                                          EPackage package_,
                                          EClass context,
                                          java.lang.String rule)
Creates a default Topcased CheckResultModel

Parameters:
model - The EMF model
mmURI - The metamodel of the model
context - The context where the rule must be take into account
rule - The OCL rule
Returns:
a default CheckResultModel

createPackage

public static Package createPackage(Model model,
                                    EPackage ePackage)
Creates a Package and adds it to the Check Result Model

Parameters:
model - The check result model
ePackage - A EPackage to represent into the model
Returns:
the created package object

createContext

public static Context createContext(Package package_,
                                    EClass context)
Creates a Context and adds it to the current Package

Parameters:
package_ - The current Package of the check result model
context - A EClass representing the context of an OCL rule.
Returns:
the created context object

createRule

public static Rule createRule(Context context,
                              java.lang.String rule)
Creates a Rule and adds it to the current context

Parameters:
context - the rule context
rule - The rule applied
Returns:
the created rule object

createAcceptedItems

public static void createAcceptedItems(Rule rule,
                                       java.util.List<?> acceptedItems)
Creates a list of the accepted items concerning a rule.

Parameters:
rule - The rule on which the items must be added
acceptedItems - List of accepted items

createRejectedItems

public static void createRejectedItems(Rule rule,
                                       java.util.List<?> acceptedItems)
Creates a list of the rejected items concerning a rule.

Parameters:
rule - The rule on which the items must be added
rejectedItems - List of rejected items

getFirstRule

public static Rule getFirstRule(Model checkResultModel)
Gets the first Rule found into a given CheckResultModel.
NOTE : only used by ModelBus services.

Parameters:
checkResultModel - A CheckResultModel previously created
Returns:
The unique object Rule contained in the given CheckResultModel

OCL

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