/** * @since 3.1 */ public EvaluationVisitor<EPackage, EClassifier, EOperation, EStructuralFeature, EEnumLiteral, EParameter, EObject, CallOperationAction, SendSignalAction, Constraint, EClass, EObject> createEvaluationVisitor( Environment<EPackage, EClassifier, EOperation, EStructuralFeature, EEnumLiteral, EParameter, EObject, CallOperationAction, SendSignalAction, Constraint, EClass, EObject> env, EvaluationEnvironment<EClassifier, EOperation, EStructuralFeature, EClass, EObject> evalEnv, Map<? extends EClass, ? extends Set<? extends EObject>> extentMap) { EvaluationVisitor<EPackage, EClassifier, EOperation, EStructuralFeature, EEnumLiteral, EParameter, EObject, CallOperationAction, SendSignalAction, Constraint, EClass, EObject> result = new EvaluationVisitorImpl( env, evalEnv, extentMap); if (isEvaluationTracingEnabled()) { // decorate the evaluation visitor with tracing support result = new TracingEvaluationVisitor(result); } return result; }
OCLExpression<EClassifier> source = pc.getSource(); Object context = source.accept(getVisitor()); if (isUndefined(context)) { return getInvalid(); Object result = ((EvaluationEnvironmentWithHiddenOpposites) getEvaluationEnvironment()) .navigateOppositeProperty(property, context); if ((pc.getType() instanceof CollectionType<?, ?>)
@Override protected OCLExpression<EClassifier> getPropertyBody( EStructuralFeature property) { OCLExpression<EClassifier> result = SettingBehavior.INSTANCE .getCachedOCLExpression(property); if (result == SettingBehavior.NO_OCL_DEFINITION) { result = null; } else if (result == null) { if (SettingBehavior.INSTANCE.hasCompileableFeatureBody(property)) { OCL ocl = OCL.newInstance(getEnvironment().getFactory()); result = SettingBehavior.INSTANCE.getFeatureBody(ocl, property); ocl.dispose(); } if (result == null) { result = super.getPropertyBody(property); } } return result; }
/** * Tries to fetch an operation body from where the * {@link OCLInvocationDelegate OCL invocation delegate} stores it. If nothing * is found, this method delegates to the base class implementation which then * performs the usual search in the OCL_NAMESPACE_URI annotation and the * environment's body condition cache. */ @Override protected OCLExpression<EClassifier> getOperationBody(EOperation operation) { OCLExpression<EClassifier> result = InvocationBehavior.INSTANCE .getCachedOCLExpression(operation); if (result == InvocationBehavior.NO_OCL_DEFINITION) { result = null; } else if (result == null) { if (InvocationBehavior.INSTANCE.hasCompileableOperationBody(operation)) { OCL ocl = OCL.newInstance(getEnvironment().getFactory()); result = InvocationBehavior.INSTANCE.getOperationBody(ocl, operation); ocl.dispose(); } if (result == null) { result = super.getOperationBody(operation); } } return result; }