Class SeverityFilter

  • All Implemented Interfaces:
    DiagnosticFilter, ValidationFilter

    public class SeverityFilter
    extends java.lang.Object
    implements DiagnosticFilter
    Convenience class to filter Diagnostics based on their severity. See ValidationService#registerValidationFilter(ValidationFilter).
    Author:
    Mat Hansen
    • Constructor Summary

      Constructors 
      Constructor Description
      SeverityFilter​(int minimumSeverity)
      Constructor with default severity.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean ignoreDiagnostic​(org.eclipse.emf.ecore.EObject eObject, org.eclipse.emf.common.util.Diagnostic diagnostic)
      Return true if the given Diagnostic should be ignored.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SeverityFilter

        public SeverityFilter​(int minimumSeverity)
        Constructor with default severity.
        Parameters:
        minimumSeverity - the minimum severity to pass, i.e. Diagnostic.WARNING
    • Method Detail

      • ignoreDiagnostic

        public boolean ignoreDiagnostic​(org.eclipse.emf.ecore.EObject eObject,
                                        org.eclipse.emf.common.util.Diagnostic diagnostic)
        Description copied from interface: DiagnosticFilter
        Return true if the given Diagnostic should be ignored. Ignored Diagnostics will not appear in the output of ValidationService#validate(EObject).
        Specified by:
        ignoreDiagnostic in interface DiagnosticFilter
        Parameters:
        eObject - the EObject that has been validated
        diagnostic - the Diagnostic as a result of the validation of the given EObject
        Returns:
        true if the given Diagnostic should not be included in the output of ValidationService#validate(EObject)