Java Code Examples for org.eclipse.emf.common.util.DiagnosticChain#add()
The following examples show how to use
org.eclipse.emf.common.util.DiagnosticChain#add() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MigrationValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the validFeature constraint of '<em>Slot</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public boolean validateSlot_validFeature(Slot slot, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_validFeature(slot)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { //$NON-NLS-1$ "validFeature", getObjectLabel((EObject) slot, context) }), //$NON-NLS-1$ new Object[] { slot })); } return false; } return true; }
Example 2
Source File: jpdl32Validator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the MemberTypes constraint of '<em>Type Type</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateTypeType_MemberTypes(Object typeType, DiagnosticChain diagnostics, Map<Object, Object> context) { if (diagnostics != null) { BasicDiagnostic tempDiagnostics = new BasicDiagnostic(); if (jpdl32Package.Literals.TYPE_TYPE_MEMBER0.isInstance(typeType)) { if (validateTypeTypeMember0((String)typeType, tempDiagnostics, context)) return true; } if (jpdl32Package.Literals.TYPE_TYPE_MEMBER1.isInstance(typeType)) { if (validateTypeTypeMember1((TypeTypeMember1)typeType, tempDiagnostics, context)) return true; } for (Diagnostic diagnostic : tempDiagnostics.getChildren()) { diagnostics.add(diagnostic); } } else { if (jpdl32Package.Literals.TYPE_TYPE_MEMBER0.isInstance(typeType)) { if (validateTypeTypeMember0((String)typeType, null, context)) return true; } if (jpdl32Package.Literals.TYPE_TYPE_MEMBER1.isInstance(typeType)) { if (validateTypeTypeMember1((TypeTypeMember1)typeType, null, context)) return true; } } return false; }
Example 3
Source File: jpdl32Validator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the MemberTypes constraint of '<em>Priority Type</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validatePriorityType_MemberTypes(Object priorityType, DiagnosticChain diagnostics, Map<Object, Object> context) { if (diagnostics != null) { BasicDiagnostic tempDiagnostics = new BasicDiagnostic(); if (jpdl32Package.Literals.PRIORITY_TYPE_MEMBER0.isInstance(priorityType)) { if (validatePriorityTypeMember0((PriorityTypeMember0)priorityType, tempDiagnostics, context)) return true; } if (jpdl32Package.Literals.PRIORITY_TYPE_MEMBER1.isInstance(priorityType)) { if (validatePriorityTypeMember1((Integer)priorityType, tempDiagnostics, context)) return true; } for (Diagnostic diagnostic : tempDiagnostics.getChildren()) { diagnostics.add(diagnostic); } } else { if (jpdl32Package.Literals.PRIORITY_TYPE_MEMBER0.isInstance(priorityType)) { if (validatePriorityTypeMember0((PriorityTypeMember0)priorityType, null, context)) return true; } if (jpdl32Package.Literals.PRIORITY_TYPE_MEMBER1.isInstance(priorityType)) { if (validatePriorityTypeMember1((Integer)priorityType, null, context)) return true; } } return false; }
Example 4
Source File: ModelValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the MemberTypes constraint of '<em>TTransaction Method</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateTTransactionMethod_MemberTypes(Object tTransactionMethod, DiagnosticChain diagnostics, Map<Object, Object> context) { if (diagnostics != null) { BasicDiagnostic tempDiagnostics = new BasicDiagnostic(); if (XMLTypePackage.Literals.ANY_URI.isInstance(tTransactionMethod)) { if (xmlTypeValidator.validateAnyURI((String)tTransactionMethod, tempDiagnostics, context)) return true; } if (ModelPackage.Literals.TTRANSACTION_METHOD_MEMBER1.isInstance(tTransactionMethod)) { if (validateTTransactionMethodMember1((TTransactionMethodMember1)tTransactionMethod, tempDiagnostics, context)) return true; } for (Diagnostic diagnostic : tempDiagnostics.getChildren()) { diagnostics.add(diagnostic); } } else { if (XMLTypePackage.Literals.ANY_URI.isInstance(tTransactionMethod)) { if (xmlTypeValidator.validateAnyURI((String)tTransactionMethod, null, context)) return true; } if (ModelPackage.Literals.TTRANSACTION_METHOD_MEMBER1.isInstance(tTransactionMethod)) { if (validateTTransactionMethodMember1((TTransactionMethodMember1)tTransactionMethod, null, context)) return true; } } return false; }
Example 5
Source File: ModelValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the MemberTypes constraint of '<em>TImplementation</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean validateTImplementation_MemberTypes(Object tImplementation, DiagnosticChain diagnostics, Map<Object, Object> context) { if (diagnostics != null) { BasicDiagnostic tempDiagnostics = new BasicDiagnostic(); if (XMLTypePackage.Literals.ANY_URI.isInstance(tImplementation)) { if (xmlTypeValidator.validateAnyURI((String)tImplementation, tempDiagnostics, context)) return true; } if (ModelPackage.Literals.TIMPLEMENTATION_MEMBER1.isInstance(tImplementation)) { if (validateTImplementationMember1((TImplementationMember1)tImplementation, tempDiagnostics, context)) return true; } for (Diagnostic diagnostic : tempDiagnostics.getChildren()) { diagnostics.add(diagnostic); } } else { if (XMLTypePackage.Literals.ANY_URI.isInstance(tImplementation)) { if (xmlTypeValidator.validateAnyURI((String)tImplementation, null, context)) return true; } if (ModelPackage.Literals.TIMPLEMENTATION_MEMBER1.isInstance(tImplementation)) { if (validateTImplementationMember1((TImplementationMember1)tImplementation, null, context)) return true; } } return false; }
Example 6
Source File: MigrationValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the validOpposite constraint of '<em>Reference Slot</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public boolean validateReferenceSlot_validOpposite(ReferenceSlot referenceSlot, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_validOpposite(referenceSlot)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { //$NON-NLS-1$ "validOpposite", getObjectLabel((EObject) referenceSlot, context) }), //$NON-NLS-1$ new Object[] { referenceSlot })); } return false; } return true; }
Example 7
Source File: MigrationValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the noDanglingReference constraint of '<em>Reference Slot</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public boolean validateReferenceSlot_noDanglingReference(ReferenceSlot referenceSlot, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_noDanglingReference(referenceSlot)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { //$NON-NLS-1$ "noDanglingReference", getObjectLabel((EObject) referenceSlot, context) }), //$NON-NLS-1$ new Object[] { referenceSlot })); } return false; } return true; }
Example 8
Source File: MigrationValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the validType constraint of '<em>Reference Slot</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public boolean validateReferenceSlot_validType(ReferenceSlot referenceSlot, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_validType(referenceSlot)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { "validType", //$NON-NLS-1$ //$NON-NLS-2$ getObjectLabel((EObject) referenceSlot, context) }), new Object[] { referenceSlot })); } return false; } return true; }
Example 9
Source File: MigrationValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the validMultiplicity constraint of '<em>Slot</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public boolean validateSlot_validMultiplicity(Slot slot, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_validMultiplicity(slot)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { //$NON-NLS-1$ "validMultiplicity", getObjectLabel((EObject) slot, context) }), //$NON-NLS-1$ new Object[] { slot })); } return false; } return true; }
Example 10
Source File: MigrationValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the validType constraint of '<em>Instance</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public boolean validateInstance_validType(Instance instance, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_validType(instance)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { "validType", //$NON-NLS-1$ //$NON-NLS-2$ getObjectLabel((EObject) instance, context) }), new Object[] { instance })); } return false; } return true; }
Example 11
Source File: MigrationValidator.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Validates the validContainment constraint of '<em>Instance</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated NOT */ public boolean validateInstance_validContainment(Instance instance, DiagnosticChain diagnostics, Map<Object, Object> context) { if (!validate_validContainment(instance)) { if (diagnostics != null) { diagnostics.add (new BasicDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString("_UI_GenericConstraint_diagnostic", new Object[] { //$NON-NLS-1$ "validContainment", getObjectLabel((EObject) instance, context) }), //$NON-NLS-1$ new Object[] { instance })); } return false; } return true; }
Example 12
Source File: FontImpl.java From fixflow with Apache License 2.0 | 6 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean non_negative_size(DiagnosticChain diagnostics, Map<Object, Object> context) { // TODO: implement this method // -> specify the condition that violates the invariant // -> verify the details of the diagnostic, including severity and message // Ensure that you remove @generated or mark it @generated NOT if (false) { if (diagnostics != null) { diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, DcValidator.DIAGNOSTIC_SOURCE, DcValidator.FONT__NON_NEGATIVE_SIZE, EcorePlugin.INSTANCE.getString( "_UI_GenericInvariant_diagnostic", new Object[] { "non_negative_size", EObjectValidator.getObjectLabel(this, context) }), new Object[] { this })); } return false; } return true; }
Example 13
Source File: PlaneImpl.java From fixflow with Apache License 2.0 | 6 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public boolean plane_element_type(DiagnosticChain diagnostics, Map<Object, Object> context) { // TODO: implement this method // -> specify the condition that violates the invariant // -> verify the details of the diagnostic, including severity and message // Ensure that you remove @generated or mark it @generated NOT if (false) { if (diagnostics != null) { diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, DiValidator.DIAGNOSTIC_SOURCE, DiValidator.PLANE__PLANE_ELEMENT_TYPE, EcorePlugin.INSTANCE.getString( "_UI_GenericInvariant_diagnostic", new Object[] { "plane_element_type", EObjectValidator.getObjectLabel(this, context) }), new Object[] { this })); } return false; } return true; }
Example 14
Source File: DomainValidator.java From statecharts with Eclipse Public License 1.0 | 6 votes |
@Override public boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) { if (eObject instanceof DomainElement) { DomainStatus status = DomainRegistry.getDomainStatus(((DomainElement) eObject).getDomainID()); if (status.getSeverity() == Severity.ERROR) { diagnostics.add(new BasicDiagnostic(Diagnostic.ERROR, "DomainValidator", 0, status.getShortMessage(), new Object[] { eObject })); } else if (status.getSeverity() == Severity.WARNING) { diagnostics.add(new BasicDiagnostic(Diagnostic.WARNING, "DomainValidator", 0, status.getMessage(), new Object[] { eObject })); } else if (status.getSeverity() == Severity.INFO) { diagnostics.add(new BasicDiagnostic(Diagnostic.INFO, "DomainValidator", 0, status.getShortMessage(), new Object[] { eObject })); } } return true; }
Example 15
Source File: CompositeEValidator.java From xtext-core with Eclipse Public License 2.0 | 6 votes |
@Override public boolean validate(EDataType eDataType, Object value, DiagnosticChain diagnostics, Map<Object, Object> context) throws OperationCanceledError { boolean result = true; for (int i = 0; i < getContents().size(); i++) { EValidatorEqualitySupport val = getContents().get(i); try { result &= val.getDelegate().validate(eDataType, value, diagnostics, context); } catch (Throwable e) { operationCanceledManager.propagateAsErrorIfCancelException(e); logger.error("Error executing EValidator", e); diagnostics.add(createExceptionDiagnostic("Error executing EValidator", eDataType, e)); } } return result; }
Example 16
Source File: CompositeEValidator.java From xtext-core with Eclipse Public License 2.0 | 6 votes |
@Override public boolean validate(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) throws OperationCanceledError { boolean result = true; for (int i = 0; i < getContents().size(); i++) { EValidatorEqualitySupport val = getContents().get(i); try { result &= val.getDelegate().validate(eClass, eObject, diagnostics, context); } catch (Throwable e) { operationCanceledManager.propagateAsErrorIfCancelException(e); logger.error("Error executing EValidator", e); diagnostics.add(createExceptionDiagnostic("Error executing EValidator", eClass, e)); } } return result; }
Example 17
Source File: CompositeEValidator.java From xtext-core with Eclipse Public License 2.0 | 6 votes |
@Override public boolean validate(EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) throws OperationCanceledError { boolean result = true; for (int i = 0; i < getContents().size(); i++) { EValidatorEqualitySupport val = getContents().get(i); try { result &= val.getDelegate().validate(eObject, diagnostics, context); } catch (Throwable e) { operationCanceledManager.propagateAsErrorIfCancelException(e); logger.error("Error executing EValidator", e); diagnostics.add(createExceptionDiagnostic("Error executing EValidator", eObject, e)); } } return result; }
Example 18
Source File: ValidationContextImpl.java From neoscada with Eclipse Public License 1.0 | 5 votes |
public boolean apply ( final DiagnosticChain diagnostics ) { for ( final Diagnostic d : this.result ) { diagnostics.add ( d ); } return this.result.isEmpty (); }
Example 19
Source File: ModelValidator.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * Validate OCL constraints and return true if OCL constraint holds, false * otherwise. */ private boolean validate_EveryInvariant(Instance instance, DiagnosticChain diagnostics, Map<Object, Object> context) { final EClass eClass = instance.getEClass(); final EAnnotation annotation = eClass.getEAnnotation(OCL_SOURCE_URI); if (annotation != null) { for (final Entry<String, String> entry : annotation.getDetails()) { try { final String expression = entry.getValue(); if (!(Boolean) evaluate(instance, expression)) { if (diagnostics != null) { diagnostics.add(new BasicDiagnostic( Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0, EcorePlugin.INSTANCE.getString( "_UI_GenericConstraint_diagnostic", //$NON-NLS-1$ new Object[] { entry.getKey(), getObjectLabel( (EObject) instance, context) }), new Object[] { instance })); } return false; } } catch (final ParserException e) { System.out.println(e); } } } return true; }