org.eclipse.xtext.validation
Class DiagnosticConverterImpl

java.lang.Object
  extended by org.eclipse.xtext.validation.DiagnosticConverterImpl
All Implemented Interfaces:
IDiagnosticConverter
Direct Known Subclasses:
XtextDiagnosticConverter

public class DiagnosticConverterImpl
extends java.lang.Object
implements IDiagnosticConverter

Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
protected static class DiagnosticConverterImpl.IssueLocation
           
 
Constructor Summary
DiagnosticConverterImpl()
           
 
Method Summary
 void convertResourceDiagnostic(org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic, Severity severity, IAcceptor<Issue> acceptor)
          Convert a resource diagnostic to zero, one or more markers.
 void convertValidatorDiagnostic(org.eclipse.emf.common.util.Diagnostic diagnostic, IAcceptor<Issue> acceptor)
          Convert a validation diagnostic to zero, one or more markers.
protected  org.eclipse.emf.ecore.EObject getCauser(org.eclipse.emf.common.util.Diagnostic diagnostic)
           
protected  DiagnosticConverterImpl.IssueLocation getLocationData(org.eclipse.emf.common.util.Diagnostic diagnostic)
           
protected  DiagnosticConverterImpl.IssueLocation getLocationData(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EStructuralFeature structuralFeature)
           
protected  DiagnosticConverterImpl.IssueLocation getLocationData(org.eclipse.emf.ecore.EObject obj, org.eclipse.emf.ecore.EStructuralFeature structuralFeature, int index)
           
protected  DiagnosticConverterImpl.IssueLocation getLocationForNode(INode node)
           
protected  org.eclipse.emf.ecore.EStructuralFeature resolveStructuralFeature(org.eclipse.emf.ecore.EObject ele, java.lang.Object feature)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DiagnosticConverterImpl

public DiagnosticConverterImpl()
Method Detail

convertResourceDiagnostic

public void convertResourceDiagnostic(org.eclipse.emf.ecore.resource.Resource.Diagnostic diagnostic,
                                      Severity severity,
                                      IAcceptor<Issue> acceptor)
Description copied from interface: IDiagnosticConverter
Convert a resource diagnostic to zero, one or more markers.

Specified by:
convertResourceDiagnostic in interface IDiagnosticConverter

convertValidatorDiagnostic

public void convertValidatorDiagnostic(org.eclipse.emf.common.util.Diagnostic diagnostic,
                                       IAcceptor<Issue> acceptor)
Description copied from interface: IDiagnosticConverter
Convert a validation diagnostic to zero, one or more markers.

Specified by:
convertValidatorDiagnostic in interface IDiagnosticConverter

getCauser

protected org.eclipse.emf.ecore.EObject getCauser(org.eclipse.emf.common.util.Diagnostic diagnostic)

getLocationData

protected DiagnosticConverterImpl.IssueLocation getLocationData(org.eclipse.emf.common.util.Diagnostic diagnostic)
Returns:
the location data for the given diagnostic.
  1. First: line number,
  2. Second: Offset of first char (inclusive), and
  3. Third: Offset of last char (exclusive).

getLocationData

protected DiagnosticConverterImpl.IssueLocation getLocationData(org.eclipse.emf.ecore.EObject obj,
                                                                org.eclipse.emf.ecore.EStructuralFeature structuralFeature)

getLocationData

protected DiagnosticConverterImpl.IssueLocation getLocationData(org.eclipse.emf.ecore.EObject obj,
                                                                org.eclipse.emf.ecore.EStructuralFeature structuralFeature,
                                                                int index)
Returns:
the location data for the given diagnostic.

getLocationForNode

protected DiagnosticConverterImpl.IssueLocation getLocationForNode(INode node)

resolveStructuralFeature

protected org.eclipse.emf.ecore.EStructuralFeature resolveStructuralFeature(org.eclipse.emf.ecore.EObject ele,
                                                                            java.lang.Object feature)