| /******************************************************************************* |
| * Copyright (c) 2010, 2018 Willink Transformations and others. |
| * All rights reserved. This program and the accompanying materials |
| * are made available under the terms of the Eclipse Public License v2.0 |
| * which accompanies this distribution, and is available at |
| * http://www.eclipse.org/legal/epl-v20.html |
| * |
| * Contributors: |
| * E.D.Willink - Initial API and implementation |
| *******************************************************************************/ |
| package org.eclipse.ocl.xtext.oclstdlibcs.util; |
| |
| import java.util.Map; |
| |
| import org.eclipse.emf.common.util.DiagnosticChain; |
| import org.eclipse.emf.common.util.ResourceLocator; |
| import org.eclipse.emf.ecore.EPackage; |
| import org.eclipse.emf.ecore.util.EObjectValidator; |
| import org.eclipse.ocl.xtext.basecs.util.BaseCSValidator; |
| import org.eclipse.ocl.xtext.oclstdlibcs.JavaImplementationCS; |
| import org.eclipse.ocl.xtext.oclstdlibcs.LibIterationCS; |
| import org.eclipse.ocl.xtext.oclstdlibcs.LibOperationCS; |
| import org.eclipse.ocl.xtext.oclstdlibcs.LibPropertyCS; |
| import org.eclipse.ocl.xtext.oclstdlibcs.OCLstdlibCSPackage; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * The <b>Validator</b> for the model. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.ocl.xtext.oclstdlibcs.OCLstdlibCSPackage |
| * @generated |
| */ |
| public class OCLstdlibCSValidator |
| extends EObjectValidator { |
| |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final OCLstdlibCSValidator INSTANCE = new OCLstdlibCSValidator(); |
| |
| /** |
| * A constant for the {@link org.eclipse.emf.common.util.Diagnostic#getSource() source} of diagnostic {@link org.eclipse.emf.common.util.Diagnostic#getCode() codes} from this package. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @see org.eclipse.emf.common.util.Diagnostic#getSource() |
| * @see org.eclipse.emf.common.util.Diagnostic#getCode() |
| * @generated |
| */ |
| public static final String DIAGNOSTIC_SOURCE = "org.eclipse.ocl.xtext.oclstdlibcs"; |
| |
| /** |
| * A constant with a fixed name that can be used as the base value for additional hand written constants. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| private static final int GENERATED_DIAGNOSTIC_CODE_COUNT = 0; |
| |
| /** |
| * A constant with a fixed name that can be used as the base value for additional hand written constants in a derived class. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static final int DIAGNOSTIC_CODE_COUNT = GENERATED_DIAGNOSTIC_CODE_COUNT; |
| |
| /** |
| * The cached base package validator. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected BaseCSValidator baseCSTValidator; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public OCLstdlibCSValidator() { |
| super(); |
| baseCSTValidator = BaseCSValidator.INSTANCE; |
| } |
| |
| /** |
| * Returns the package of this validator switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EPackage getEPackage() { |
| return OCLstdlibCSPackage.eINSTANCE; |
| } |
| |
| /** |
| * Calls <code>validateXXX</code> for the corresponding classifier of the model. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected boolean validate(int classifierID, Object value, |
| DiagnosticChain diagnostics, Map<Object, Object> context) { |
| switch (classifierID) |
| { |
| case OCLstdlibCSPackage.LIB_ITERATION_CS: |
| return validateLibIterationCS((LibIterationCS)value, diagnostics, context); |
| case OCLstdlibCSPackage.LIB_OPERATION_CS: |
| return validateLibOperationCS((LibOperationCS)value, diagnostics, context); |
| case OCLstdlibCSPackage.LIB_PROPERTY_CS: |
| return validateLibPropertyCS((LibPropertyCS)value, diagnostics, context); |
| case OCLstdlibCSPackage.JAVA_IMPLEMENTATION_CS: |
| return validateJavaImplementationCS((JavaImplementationCS)value, diagnostics, context); |
| default: |
| return true; |
| } |
| } |
| |
| /** |
| * The cached validation expression for the TestConstraint2 constraint of '<em>Lib Document CS</em>'. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| protected static final String LIB_DOCUMENT_CS__TEST_CONSTRAINT2__EEXPRESSION = "true"; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateLibIterationCS(LibIterationCS libIterationCS, |
| DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(libIterationCS, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateLibOperationCS(LibOperationCS libOperationCS, |
| DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(libOperationCS, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateLibPropertyCS(LibPropertyCS libPropertyCS, |
| DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(libPropertyCS, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateJavaImplementationCS( |
| JavaImplementationCS javaImplementationCS, |
| DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(javaImplementationCS, diagnostics, context); |
| } |
| |
| /** |
| * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| public ResourceLocator getResourceLocator() { |
| // TODO |
| // Specialize this to return a resource locator for messages specific to this validator. |
| // Ensure that you remove @generated or mark it @generated NOT |
| return super.getResourceLocator(); |
| } |
| |
| } //OCLstdlibCSValidator |