/*******************************************************************************
 * Copyright (c) 2018 IRT AESE (IRT Saint Exupéry).
 * 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
 * https://www.eclipse.org/legal/epl-2.0
 *
 * Contributors:
 *     Arnaud Dieumegard (IRT Saint Exupéry) - initial API and implementation
 *     Pierre Virelizier (IRT Saint Exupéry)
 *     Julien Baclet (IRT Saint Exupéry)
 *     Pierre Gaufillet (IRT Saint Exupéry)
 *******************************************************************************/
/**
 */
package com.irtsaintexupery.pseim.seim.util;

import com.irtsaintexupery.pseim.seim.*;

import java.util.Map;

import org.eclipse.emf.common.util.Diagnostic;
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;

/**
 * <!-- begin-user-doc -->
 * The <b>Validator</b> for the model.
 * <!-- end-user-doc -->
 * @see com.irtsaintexupery.pseim.seim.SeimPackage
 * @generated
 */
public class SeimValidator extends EObjectValidator {
	/**
	 * The cached model package
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final SeimValidator INSTANCE = new SeimValidator();

	/**
	 * 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 = "com.irtsaintexupery.pseim.seim";

	/**
	 * 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;

	/**
	 * Creates an instance of the switch.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public SeimValidator() {
		super();
	}

	/**
	 * Returns the package of this validator switch.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EPackage getEPackage() {
		return SeimPackage.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 SeimPackage.COMPONENT:
			return validateComponent((Component) value, diagnostics, context);
		case SeimPackage.PORT:
			return validatePort((Port) value, diagnostics, context);
		case SeimPackage.LINK:
			return validateLink((Link) value, diagnostics, context);
		case SeimPackage.GRAPH_ELEMENT:
			return validateGraphElement((GraphElement) value, diagnostics, context);
		case SeimPackage.PROPERTY:
			return validateProperty((Property) value, diagnostics, context);
		case SeimPackage.BASIC_PROPERTY:
			return validateBasicProperty((BasicProperty) value, diagnostics, context);
		case SeimPackage.INTEGER_PROPERTY:
			return validateIntegerProperty((IntegerProperty) value, diagnostics, context);
		case SeimPackage.STRING_PROPERTY:
			return validateStringProperty((StringProperty) value, diagnostics, context);
		case SeimPackage.BOOLEAN_PROPERTY:
			return validateBooleanProperty((BooleanProperty) value, diagnostics, context);
		case SeimPackage.REFERENCE_PROPERTY:
			return validateReferenceProperty((ReferenceProperty) value, diagnostics, context);
		case SeimPackage.PROPERTY_HOLDER:
			return validatePropertyHolder((PropertyHolder) value, diagnostics, context);
		case SeimPackage.NAMED_ELEMENT:
			return validateNamedElement((NamedElement) value, diagnostics, context);
		case SeimPackage.IDENTIFIED_ELEMENT:
			return validateIdentifiedElement((IdentifiedElement) value, diagnostics, context);
		case SeimPackage.MODEL:
			return validateModel((Model) value, diagnostics, context);
		case SeimPackage.BORDER_ELEMENT:
			return validateBorderElement((BorderElement) value, diagnostics, context);
		case SeimPackage.ELEMENT:
			return validateElement((Element) value, diagnostics, context);
		case SeimPackage.PORT_DIRECTION:
			return validatePortDirection((PortDirection) value, diagnostics, context);
		default:
			return true;
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateComponent(Component component, DiagnosticChain diagnostics, Map<Object, Object> context) {
		if (!validate_NoCircularContainment(component, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(component, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(component, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validatePort(Port port, DiagnosticChain diagnostics, Map<Object, Object> context) {
		if (!validate_NoCircularContainment(port, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(port, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(port, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateLink(Link link, DiagnosticChain diagnostics, Map<Object, Object> context) {
		if (!validate_NoCircularContainment(link, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(link, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(link, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateGraphElement(GraphElement graphElement, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(graphElement, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(graphElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(graphElement, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateProperty(Property property, DiagnosticChain diagnostics, Map<Object, Object> context) {
		if (!validate_NoCircularContainment(property, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(property, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateProperty_keyNotNull(property, diagnostics, context);
		return result;
	}

	/**
	 * The cached validation expression for the keyNotNull constraint of '<em>Property</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static final String PROPERTY__KEY_NOT_NULL__EEXPRESSION = "not(key.oclIsUndefined()) and key <> ''";

	/**
	 * Validates the keyNotNull constraint of '<em>Property</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateProperty_keyNotNull(Property property, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		return validate(SeimPackage.Literals.PROPERTY, property, diagnostics, context,
				"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "keyNotNull", PROPERTY__KEY_NOT_NULL__EEXPRESSION,
				Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateBasicProperty(BasicProperty basicProperty, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(basicProperty, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(basicProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateProperty_keyNotNull(basicProperty, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateIntegerProperty(IntegerProperty integerProperty, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(integerProperty, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(integerProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateProperty_keyNotNull(integerProperty, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateStringProperty(StringProperty stringProperty, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(stringProperty, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(stringProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateProperty_keyNotNull(stringProperty, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateBooleanProperty(BooleanProperty booleanProperty, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(booleanProperty, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(booleanProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateProperty_keyNotNull(booleanProperty, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateReferenceProperty(ReferenceProperty referenceProperty, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(referenceProperty, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(referenceProperty, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateProperty_keyNotNull(referenceProperty, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validatePropertyHolder(PropertyHolder propertyHolder, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(propertyHolder, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(propertyHolder, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(propertyHolder, diagnostics, context);
		return result;
	}

	/**
	 * The cached validation expression for the uniqueKeys constraint of '<em>Property Holder</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static final String PROPERTY_HOLDER__UNIQUE_KEYS__EEXPRESSION = "properties->forAll(p1, p2 | p1 <> p2 implies p1.key <> p2.key)";

	/**
	 * Validates the uniqueKeys constraint of '<em>Property Holder</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validatePropertyHolder_uniqueKeys(PropertyHolder propertyHolder, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		return validate(SeimPackage.Literals.PROPERTY_HOLDER, propertyHolder, diagnostics, context,
				"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uniqueKeys",
				PROPERTY_HOLDER__UNIQUE_KEYS__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateNamedElement(NamedElement namedElement, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(namedElement, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(namedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(namedElement, diagnostics, context);
		return result;
	}

	/**
	 * The cached validation expression for the nameNotEmpty constraint of '<em>Named Element</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static final String NAMED_ELEMENT__NAME_NOT_EMPTY__EEXPRESSION = "name <> ''";

	/**
	 * Validates the nameNotEmpty constraint of '<em>Named Element</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateNamedElement_nameNotEmpty(NamedElement namedElement, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		return validate(SeimPackage.Literals.NAMED_ELEMENT, namedElement, diagnostics, context,
				"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "nameNotEmpty",
				NAMED_ELEMENT__NAME_NOT_EMPTY__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateIdentifiedElement(IdentifiedElement identifiedElement, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(identifiedElement, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(identifiedElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(identifiedElement, diagnostics, context);
		return result;
	}

	/**
	 * The cached validation expression for the uidNotEmpty constraint of '<em>Identified Element</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected static final String IDENTIFIED_ELEMENT__UID_NOT_EMPTY__EEXPRESSION = "uid <> ''";

	/**
	 * Validates the uidNotEmpty constraint of '<em>Identified Element</em>'.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateIdentifiedElement_uidNotEmpty(IdentifiedElement identifiedElement,
			DiagnosticChain diagnostics, Map<Object, Object> context) {
		return validate(SeimPackage.Literals.IDENTIFIED_ELEMENT, identifiedElement, diagnostics, context,
				"http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "uidNotEmpty",
				IDENTIFIED_ELEMENT__UID_NOT_EMPTY__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateModel(Model model, DiagnosticChain diagnostics, Map<Object, Object> context) {
		if (!validate_NoCircularContainment(model, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(model, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(model, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateBorderElement(BorderElement borderElement, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		if (!validate_NoCircularContainment(borderElement, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(borderElement, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(borderElement, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validateElement(Element element, DiagnosticChain diagnostics, Map<Object, Object> context) {
		if (!validate_NoCircularContainment(element, diagnostics, context))
			return false;
		boolean result = validate_EveryMultiplicityConforms(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryDataValueConforms(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryReferenceIsContained(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryBidirectionalReferenceIsPaired(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryProxyResolves(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_UniqueID(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryKeyUnique(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validate_EveryMapEntryUnique(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateIdentifiedElement_uidNotEmpty(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validateNamedElement_nameNotEmpty(element, diagnostics, context);
		if (result || diagnostics != null)
			result &= validatePropertyHolder_uniqueKeys(element, diagnostics, context);
		return result;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean validatePortDirection(PortDirection portDirection, DiagnosticChain diagnostics,
			Map<Object, Object> context) {
		return true;
	}

	/**
	 * 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();
	}

} //SeimValidator
