org.eclipse.viatra.query.patternlanguage.emf.util

## Class ResourceDiagnosticFeedback

- java.lang.Object
- - org.eclipse.viatra.query.patternlanguage.emf.util.ResourceDiagnosticFeedback

- All Implemented Interfaces:
    IErrorFeedback

      public final class ResourceDiagnosticFeedback
      extends java.lang.Object
      implements IErrorFeedback

  An error feedback implementation that creates diagnostics in EMF resources.
  Since:
    1.2

- - ### Field Summary

    - ### Fields inherited from interface org.eclipse.viatra.query.patternlanguage.emf.util.IErrorFeedback

      `FRAGMENT_ERROR_TYPE, JVMINFERENCE_ERROR_TYPE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ResourceDiagnosticFeedback()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clearMarkers(org.eclipse.emf.ecore.resource.Resource resource, java.lang.String markerType)` Clears all problem markers from the resource and all its descendants.
    `void` | `reportError(org.eclipse.emf.ecore.EObject ctx, java.lang.String message, java.lang.String errorCode, org.eclipse.xtext.diagnostics.Severity severity, java.lang.String markerType)` Reports an error in a context object.
    `void` | `reportError(org.eclipse.emf.ecore.resource.Resource file, java.lang.String message, java.lang.String errorCode, org.eclipse.xtext.diagnostics.Severity severity, java.lang.String markerType)` Reports an error in a file, but is not associated to any specific line.
    `void` | `reportErrorNoLocation(org.eclipse.emf.ecore.EObject ctx, java.lang.String message, java.lang.String errorCode, org.eclipse.xtext.diagnostics.Severity severity, java.lang.String markerType)` Reports an error in a context object.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ResourceDiagnosticFeedback

          public ResourceDiagnosticFeedback()

  - ### Method Detail

    - #### clearMarkers

          public void clearMarkers(org.eclipse.emf.ecore.resource.Resource resource,
                                   java.lang.String markerType)

      Description copied from interface: `IErrorFeedback`
      Clears all problem markers from the resource and all its descendants.
      Specified by:
        `clearMarkers` in interface `IErrorFeedback`
      Parameters:
        `resource` - a file, folder or project to clean all markers from
        `markerType` - `IErrorFeedback.JVMINFERENCE_ERROR_TYPE` and `IErrorFeedback.FRAGMENT_ERROR_TYPE` are supported

    - #### reportError

          public void reportError(org.eclipse.emf.ecore.EObject ctx,
                                  java.lang.String message,
                                  java.lang.String errorCode,
                                  org.eclipse.xtext.diagnostics.Severity severity,
                                  java.lang.String markerType)

      Description copied from interface: `IErrorFeedback`
      Reports an error in a context object. The error marker only appears if the context object is contained in a workspace resource, and then it is associated with the location of the context object in the textual file. All runtime errors related to the creation of the marker are logged.
      Specified by:
        `reportError` in interface `IErrorFeedback`
        `errorCode` - an arbitrary error code
        `markerType` - `IErrorFeedback.JVMINFERENCE_ERROR_TYPE` and `IErrorFeedback.FRAGMENT_ERROR_TYPE` are supported

    - #### reportErrorNoLocation

          public void reportErrorNoLocation(org.eclipse.emf.ecore.EObject ctx,
                                            java.lang.String message,
                                            java.lang.String errorCode,
                                            org.eclipse.xtext.diagnostics.Severity severity,
                                            java.lang.String markerType)

      Description copied from interface: `IErrorFeedback`
      Reports an error in a context object. The error marker only appears if the context object is contained in a workspace resource, but it is NOT associated with the location of the context object in the textual file. All runtime errors related to the creation of the marker are logged.
      Specified by:
        `reportErrorNoLocation` in interface `IErrorFeedback`
        `errorCode` - an arbitrary error code
        `markerType` - `IErrorFeedback.JVMINFERENCE_ERROR_TYPE` and `IErrorFeedback.FRAGMENT_ERROR_TYPE` are supported

    - #### reportError

          public void reportError(org.eclipse.emf.ecore.resource.Resource file,
                                  java.lang.String message,
                                  java.lang.String errorCode,
                                  org.eclipse.xtext.diagnostics.Severity severity,
                                  java.lang.String markerType)

      Description copied from interface: `IErrorFeedback`
      Reports an error in a file, but is not associated to any specific line. All runtime errors related to the creation of the marker are logged.
      Specified by:
        `reportError` in interface `IErrorFeedback`
        `errorCode` - an arbitrary error code
        `markerType` - `IErrorFeedback.JVMINFERENCE_ERROR_TYPE` and `IErrorFeedback.FRAGMENT_ERROR_TYPE` are supported