| /** |
| */ |
| package org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.util; |
| |
| import java.math.BigInteger; |
| import java.util.Map; |
| |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.*; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DocumentRoot; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.GlobalType; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.ImportType; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaDataType; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.MetaValueType; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnEntryScriptType; |
| import org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.OnExitScriptType; |
| 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.emf.ecore.xml.type.util.XMLTypeValidator; |
| |
| /** |
| * <!-- begin-user-doc --> |
| * The <b>Validator</b> for the model. |
| * <!-- end-user-doc --> |
| * @see org.eclipse.bpmn2.modeler.runtime.jboss.jbpm5.model.drools.DroolsPackage |
| * @generated |
| */ |
| public class DroolsValidator extends EObjectValidator { |
| /** |
| * The cached model package |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public static final DroolsValidator INSTANCE = new DroolsValidator(); |
| |
| /** |
| * 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.bpmn2.modeler.runtime.jboss.jbpm5.model.drools"; |
| |
| /** |
| * 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 XMLTypeValidator xmlTypeValidator; |
| |
| /** |
| * Creates an instance of the switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public DroolsValidator() { |
| super(); |
| xmlTypeValidator = XMLTypeValidator.INSTANCE; |
| } |
| |
| /** |
| * Returns the package of this validator switch. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| @Override |
| protected EPackage getEPackage() { |
| return DroolsPackage.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 DroolsPackage.DOCUMENT_ROOT: |
| return validateDocumentRoot((DocumentRoot)value, diagnostics, context); |
| case DroolsPackage.GLOBAL_TYPE: |
| return validateGlobalType((GlobalType)value, diagnostics, context); |
| case DroolsPackage.IMPORT_TYPE: |
| return validateImportType((ImportType)value, diagnostics, context); |
| case DroolsPackage.META_DATA_TYPE: |
| return validateMetaDataType((MetaDataType)value, diagnostics, context); |
| case DroolsPackage.META_VALUE_TYPE: |
| return validateMetaValueType((MetaValueType)value, diagnostics, context); |
| case DroolsPackage.ON_ENTRY_SCRIPT_TYPE: |
| return validateOnEntryScriptType((OnEntryScriptType)value, diagnostics, context); |
| case DroolsPackage.ON_EXIT_SCRIPT_TYPE: |
| return validateOnExitScriptType((OnExitScriptType)value, diagnostics, context); |
| case DroolsPackage.BP_SIM_DATA_TYPE: |
| return validateBPSimDataType((BPSimDataType)value, diagnostics, context); |
| case DroolsPackage.EXTERNAL_PROCESS: |
| return validateExternalProcess((ExternalProcess)value, diagnostics, context); |
| case DroolsPackage.PACKAGE_NAME_TYPE: |
| return validatePackageNameType((String)value, diagnostics, context); |
| case DroolsPackage.PRIORITY_TYPE: |
| return validatePriorityType((BigInteger)value, diagnostics, context); |
| case DroolsPackage.RULE_FLOW_GROUP_TYPE: |
| return validateRuleFlowGroupType((String)value, diagnostics, context); |
| case DroolsPackage.TASK_NAME_TYPE: |
| return validateTaskNameType((String)value, diagnostics, context); |
| case DroolsPackage.VERSION_TYPE: |
| return validateVersionType((String)value, diagnostics, context); |
| default: |
| return true; |
| } |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateDocumentRoot(DocumentRoot documentRoot, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(documentRoot, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateGlobalType(GlobalType globalType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(globalType, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateImportType(ImportType importType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(importType, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateMetaDataType(MetaDataType metaDataType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(metaDataType, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateMetaValueType(MetaValueType metaValueType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(metaValueType, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateOnEntryScriptType(OnEntryScriptType onEntryScriptType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(onEntryScriptType, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateOnExitScriptType(OnExitScriptType onExitScriptType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(onExitScriptType, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateBPSimDataType(BPSimDataType bpSimDataType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(bpSimDataType, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateExternalProcess(ExternalProcess externalProcess, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return validate_EveryDefaultConstraint(externalProcess, diagnostics, context); |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validatePackageNameType(String packageNameType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return true; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validatePriorityType(BigInteger priorityType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| boolean result = validatePriorityType_Min(priorityType, diagnostics, context); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| * @see #validatePriorityType_Min |
| */ |
| public static final BigInteger PRIORITY_TYPE__MIN__VALUE = new BigInteger("1"); |
| |
| /** |
| * Validates the Min constraint of '<em>Priority Type</em>'. |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validatePriorityType_Min(BigInteger priorityType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| boolean result = priorityType.compareTo(PRIORITY_TYPE__MIN__VALUE) >= 0; |
| if (!result && diagnostics != null) |
| reportMinViolation(DroolsPackage.Literals.PRIORITY_TYPE, priorityType, PRIORITY_TYPE__MIN__VALUE, true, diagnostics, context); |
| return result; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateRuleFlowGroupType(String ruleFlowGroupType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return true; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateTaskNameType(String taskNameType, DiagnosticChain diagnostics, Map<Object, Object> context) { |
| return true; |
| } |
| |
| /** |
| * <!-- begin-user-doc --> |
| * <!-- end-user-doc --> |
| * @generated |
| */ |
| public boolean validateVersionType(String versionType, 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(); |
| } |
| |
| } //DroolsValidator |