/** * 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(); }
@Override protected boolean validate_MultiplicityConforms(EObject eObject, EStructuralFeature eStructuralFeature, DiagnosticChain diagnostics, Map<Object, Object> context) { return eStructuralFeature == GenModelPackage.Literals.GEN_DATA_TYPE__ECORE_DATA_TYPE && eObject instanceof GenEnum || super.validate_MultiplicityConforms(eObject, eStructuralFeature, diagnostics, context); }
/** * Returns a translated message with the given substitutions. * The {@link #getResourceLocator() resource locator} is used. * @param key the key for the message. * @param substitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @return the message. * @since 2.4 */ protected String getString(String key, Object [] substitutions) { return getString(isEcoreString(key) ? getEcoreResourceLocator() : getResourceLocator(), key, substitutions); }
/** * @since 2.6 */ protected static void reportInvariantDelegateException(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, EOperation invariant, int severity, String source, int code, Throwable throwable) { diagnostics.add (new BasicDiagnostic (severity, source, code, EcorePlugin.INSTANCE.getString("_UI_InvariantDelegateException_diagnostic", new Object[] { invariant.getName(), getObjectLabel(eObject, context), throwable.getClass().getName() + ": " + throwable.getLocalizedMessage() }), new Object [] { eObject, throwable })); }
/** * @since 2.6 */ protected void reportConstraintDelegateNotFound(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, String validationDelegate) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateNotFound_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context), validationDelegate }), new Object [] { eObject })); }
protected DiagnosticChain createBadDataValueDiagnostic (EObject eObject, EAttribute eAttribute, DiagnosticChain diagnostics, Map<Object, Object> context) { BasicDiagnostic diagnostic = createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, EOBJECT__EVERY_DATA_VALUE_CONFORMS, "_UI_BadDataValue_diagnostic", new Object [] { getFeatureLabel(eAttribute, context), getObjectLabel(eObject, context) }, new Object [] { eObject, eAttribute }, context); diagnostics.add(diagnostic); return diagnostic; }
(createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, new Object [] getObjectLabel(eObject, context), }, new Object [] { eObject },
EValidator rootValidator = getRootEValidator(context); Object value = eObject.eGet(eAttribute); if (FeatureMapUtil.isFeatureMap(eAttribute)) if (entryFeatureDiagnostic == null) entryFeatureDiagnostic = createBadDataValueDiagnostic(eObject, (EAttribute)entryFeature, diagnostics, context); entryFeatureToDiagnosticChainMap.put(entryFeature, entryFeatureDiagnostic); DiagnosticChain diagnostic = createBadDataValueDiagnostic(eObject, eAttribute, diagnostics, context); for (Iterator<?> i = ((List<?>)value).iterator(); i.hasNext(); ) if (!result && diagnostics != null) DiagnosticChain diagnostic = createBadDataValueDiagnostic(eObject, eAttribute, diagnostics, context); rootValidator.validate(eDataType, value, diagnostic, context);
public boolean validate_EveryDataValueConforms(EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) { boolean result = true; for (EAttribute eAttribute : eObject.eClass().getEAllAttributes()) { result &= validate_DataValueConforms(eObject, eAttribute, diagnostics, context); if (!result && diagnostics == null) { return false; } } return result; }
/** * @since 2.6 */ protected static void reportInvariantDelegateException(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, EOperation invariant, int severity, String source, int code, Throwable throwable) { diagnostics.add (new BasicDiagnostic (severity, source, code, EcorePlugin.INSTANCE.getString("_UI_InvariantDelegateException_diagnostic", new Object[] { invariant.getName(), getObjectLabel(eObject, context), throwable.getClass().getName() + ": " + throwable.getLocalizedMessage() }), new Object [] { eObject, throwable })); }
/** * @since 2.6 */ protected void reportConstraintDelegateViolation(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_GenericConstraint_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context) }), new Object [] { eObject })); }
/** * Returns a translated message with the given substitutions. * The {@link #getResourceLocator() resource locator} is used. * @param key the key for the message. * @param substitutions the substitutions for the key; <code>null</code> if there are no substitutions. * @return the message. * @since 2.4 */ protected String getString(String key, Object [] substitutions) { return getString(isEcoreString(key) ? getEcoreResourceLocator() : getResourceLocator(), key, substitutions); }
protected DiagnosticChain createBadDataValueDiagnostic (EObject eObject, EAttribute eAttribute, DiagnosticChain diagnostics, Map<Object, Object> context) { BasicDiagnostic diagnostic = createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, EOBJECT__EVERY_DATA_VALUE_CONFORMS, "_UI_BadDataValue_diagnostic", new Object [] { getFeatureLabel(eAttribute, context), getObjectLabel(eObject, context) }, new Object [] { eObject, eAttribute }, context); diagnostics.add(diagnostic); return diagnostic; }
(createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, new Object [] getObjectLabel(eObject, context), }, new Object [] { eObject },
EValidator rootValidator = getRootEValidator(context); Object value = eObject.eGet(eAttribute); if (FeatureMapUtil.isFeatureMap(eAttribute)) if (entryFeatureDiagnostic == null) entryFeatureDiagnostic = createBadDataValueDiagnostic(eObject, (EAttribute)entryFeature, diagnostics, context); entryFeatureToDiagnosticChainMap.put(entryFeature, entryFeatureDiagnostic); DiagnosticChain diagnostic = createBadDataValueDiagnostic(eObject, eAttribute, diagnostics, context); for (Iterator<?> i = ((List<?>)value).iterator(); i.hasNext(); ) if (!result && diagnostics != null) DiagnosticChain diagnostic = createBadDataValueDiagnostic(eObject, eAttribute, diagnostics, context); rootValidator.validate(eDataType, value, diagnostic, context);
public boolean validate_EveryDataValueConforms(EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context) { boolean result = true; for (EAttribute eAttribute : eObject.eClass().getEAllAttributes()) { result &= validate_DataValueConforms(eObject, eAttribute, diagnostics, context); if (!result && diagnostics == null) { return false; } } return result; }
/** * @since 2.6 */ protected static void reportInvariantDelegateNotFound(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, EOperation invariant, int severity, String source, int code, String validationDelegate) { diagnostics.add (new BasicDiagnostic (severity, source, code, EcorePlugin.INSTANCE.getString("_UI_InvariantDelegateNotFound_diagnostic", new Object[] { invariant.getName(), getObjectLabel(eObject, context), validationDelegate }), new Object [] { eObject })); }
/** * 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(); }
/** * @since 2.6 */ protected void reportConstraintDelegateException(EClass eClass, EObject eObject, DiagnosticChain diagnostics, Map<Object, Object> context, String constraint, int severity, String source, int code, Throwable throwable) { diagnostics.add (new BasicDiagnostic (severity, source, code, getString("_UI_ConstraintDelegateException_diagnostic", new Object[] { constraint, getObjectLabel(eObject, context), throwable.getClass().getName() + ": " + throwable.getLocalizedMessage() }), new Object [] { eObject, throwable })); }
(createDiagnostic (Diagnostic.ERROR, DIAGNOSTIC_SOURCE, new Object [] getFeatureLabel(i.feature(), context), getObjectLabel(eObject, context), getObjectLabel(eCrossReferenceObject, context) }, new Object [] { eObject, i.feature(), eCrossReferenceObject },