本文整理汇总了Java中org.eclipse.ocl.pivot.utilities.OCL类的典型用法代码示例。如果您正苦于以下问题:Java OCL类的具体用法?Java OCL怎么用?Java OCL使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OCL类属于org.eclipse.ocl.pivot.utilities包,在下文中一共展示了OCL类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: execute
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public static List<Diagnostic> execute(Model model){
OCLstdlibStandaloneSetup.doSetup();
EssentialOCLStandaloneSetup.doSetup();
CompleteOCLStandaloneSetup.doSetup();
OCLstdlib.install();
OCL ocl = OCL.newInstance();
List<String> oclFilePaths = new ArrayList<String>();
oclFilePaths.add("model/ontouml.ocl");
if(checkTypes) oclFilePaths.add("model/types.ocl");
if(checkRelationships) oclFilePaths.add("model/relationships.ocl");
if(checkMetaAttributes) oclFilePaths.add("model/metaattributes.ocl");
if(checkBinaryProperties) oclFilePaths.add("model/binproperties.ocl");
if(checkDependencies) oclFilePaths.add("model/dependency.ocl");
if(checkCardinalities) oclFilePaths.add("model/cardinalities.ocl");
ComposedEValidator composed = ComposedEValidator.install(OntoumlPackage.eINSTANCE);
for(String oclPath: oclFilePaths){
File file = new File(oclPath);
URI oclURI = URI.createFileURI(file.getAbsolutePath());
CompleteOCLEObjectValidator myValidator = new CompleteOCLEObjectValidator(OntoumlPackage.eINSTANCE, oclURI, ocl.getEnvironmentFactory());
EValidator.Registry.INSTANCE.put(OntoumlPackage.eINSTANCE, myValidator);
composed.addChild(myValidator);
}
Diagnostic diagnostics = Diagnostician.INSTANCE.validate(model);
return diagnostics.getChildren();
}
示例2: checkConstraint
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public boolean checkConstraint(EObject modelObj, String oclConstraint) {
OCL ocl = OCL.newInstance();
try {
OCLHelper helper = ocl.createOCLHelper(modelObj.eClass());
ExpressionInOCL expression = helper.createInvariant(oclConstraint);
return ocl.check(modelObj, expression);
}
catch (Exception e) {
MMINTException.print(IStatus.WARNING, "Error in OCL constraint \"" + oclConstraint + "\" applied to model object " + modelObj + ", evaluating to false", e);
return false;
}
finally {
ocl.dispose();
}
}
示例3: evaluateQuery
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public Object evaluateQuery(EObject modelObj, String oclConstraint) {
OCL ocl = OCL.newInstance();
try {
OCLHelper helper = ocl.createOCLHelper(modelObj.eClass());
ExpressionInOCL expression = helper.createQuery(oclConstraint);
Object evaluation = ocl.evaluate(modelObj, expression);
if (evaluation instanceof CollectionValue.Accumulator) {
evaluation = ((CollectionValue.Accumulator) evaluation).getElements();
}
if (evaluation instanceof SetValue) {
evaluation = ((SetValue) evaluation).getElements();
}
if (evaluation instanceof OrderedSetValue) {
evaluation = ((OrderedSetValue) evaluation).getElements();
}
return evaluation;
}
catch (Exception e) {
MMINTException.print(IStatus.ERROR, "OCL derivation error: " + oclConstraint, e);
return null;
}
}
示例4: createTypeDependencyGraph
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public static IGraph<Type> createTypeDependencyGraph(URI cs2asDocURI) {
OCL ocl = getOCL();
Resource cs2asResource = ocl.parse(cs2asDocURI);
TypeDependencyGraphComputer inputTypeGraphComp = new TypeDependencyGraphComputer(ocl);
IGraph<Type> graph = inputTypeGraphComp.computeDependencyGraph(cs2asResource);
ocl.dispose();
return graph;
}
示例5: createFeatureDependencyGraph
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public static IGraph<FeatureObj> createFeatureDependencyGraph(URI cs2asDocURI) {
OCL ocl = getOCL();
Resource cs2asResource = ocl.parse(cs2asDocURI);
FeatureDependencyGraphComputer featGraphComp = new FeatureDependencyGraphComputer(ocl);
IGraph<FeatureObj> graph = featGraphComp.computeDependencyGraph(cs2asResource);
ocl.dispose();
return graph;
}
示例6: createCS2ASAnalysisGraph
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public static Graph createCS2ASAnalysisGraph(URI cs2asDocURI) {
OCL ocl = getOCL();
Resource cs2asResource = ocl.parse(cs2asDocURI);
CS2ASAnalysisGraphComputer cs2asAnalysisGraphComp = new CS2ASAnalysisGraphComputer(ocl);
Graph graph = cs2asAnalysisGraphComp.computeDependencyGraph(cs2asResource);
ocl.dispose();
return graph;
}
示例7: getPivotResource
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
private static Resource getPivotResource(URI oclDocumentURI) {
CompleteOCLStandaloneSetup.doSetup();
OCL ocl = OCL.newInstance();
// parse the contents as an OCL document
return ocl.parse(oclDocumentURI);
}
示例8: AbstractDependencyGraphComputer
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public AbstractDependencyGraphComputer(OCL ocl) {
this.mManager = ocl.getMetamodelManager();
}
示例9: TypeDependencyGraphComputer
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public TypeDependencyGraphComputer(OCL ocl) {
super(ocl);
}
示例10: CS2ASAnalysisGraphComputer
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public CS2ASAnalysisGraphComputer(OCL ocl) {
super(ocl);
}
示例11: AbstractGraphComputer
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public AbstractGraphComputer(OCL ocl) {
mManager = ocl.getMetamodelManager();
}
示例12: getOCL
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
private static OCL getOCL() {
OCLstdlib.install();
CompleteOCLStandaloneSetup.doSetup();
return OCL.newInstance();
}
示例13: FeatureDependencyGraphComputer
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public FeatureDependencyGraphComputer(OCL ocl) {
super(ocl);
}
示例14: OldDependencyGraphComputer
import org.eclipse.ocl.pivot.utilities.OCL; //导入依赖的package包/类
public OldDependencyGraphComputer(OCL ocl) {
super(ocl);
}