Class AbstractReferencedGrammarLSPErrorReporter

java.lang.Object
org.apache.xerces.impl.XMLErrorReporter
org.eclipse.lemminx.extensions.xerces.AbstractLSPErrorReporter
org.eclipse.lemminx.extensions.xerces.AbstractReferencedGrammarLSPErrorReporter
All Implemented Interfaces:
org.apache.xerces.xni.parser.XMLComponent
Direct Known Subclasses:
LSPErrorReporterForXML, LSPErrorReporterForXSD

public abstract class AbstractReferencedGrammarLSPErrorReporter extends AbstractLSPErrorReporter
Abstract class reporter with referenced grammar.
Author:
Angelo ZERR
  • Field Details

  • Constructor Details

  • Method Details

    • toLSPRange

      protected org.eclipse.lsp4j.Range toLSPRange(org.apache.xerces.xni.XMLLocator location, String key, Object[] arguments, String message, org.eclipse.lsp4j.DiagnosticSeverity diagnosticSeverity, boolean fatalError, DOMDocument document)
      Create the LSP range from the SAX error.
      Specified by:
      toLSPRange in class AbstractLSPErrorReporter
      Parameters:
      location -
      key -
      arguments -
      document -
      message - the Xerces error message.
      diagnosticSeverity - the the Xerces severity.
      fatalError - true if Xerces report the error as fatal and false otherwise.
      Returns:
      the LSP range from the SAX error.
    • fillReferencedGrammarDiagnostic

      protected void fillReferencedGrammarDiagnostic(org.apache.xerces.xni.XMLLocator location, String key, Object[] arguments, String message, org.eclipse.lsp4j.DiagnosticSeverity diagnosticSeverity, boolean fatalError, URIResolverExtensionManager resolverExtensionManager, XMLSyntaxErrorCode syntaxCode, XMLSchemaErrorCode schemaErrorCode, DTDErrorCode dtdCode, XSDErrorCode xsdCode, RelaxNGErrorCode rngCode, XIncludeErrorCode xIncludeCode, String grammarURI)
      Create a diagnostic root where XSD, DTD which have the error if needed and attach the error as related information if LSP client support it.
      Parameters:
      location - the Xerces location.
      key - the Xerces error key
      arguments - the Xerces error arguments
      message - the Xerces error message
      diagnosticSeverity - the the Xerces severity
      fatalError -
      resolverExtensionManager - the resolver
      syntaxCode - the Syntax error code and null otherwise.
      dtdCode - the DTD error code and null otherwise.
      xsdCode - the XSD error code and null otherwise.
      rngCode - the RelaxNG error code and null otherwise.
      grammarURI - the referenced grammar URI.
    • endReport

      public void endReport()
    • getMessage

      protected String getMessage(String domain, String key, Object[] arguments, Exception exception)
      Overrides:
      getMessage in class AbstractLSPErrorReporter
    • getSeverity

      protected org.eclipse.lsp4j.DiagnosticSeverity getSeverity(String domain, String key, Object[] arguments, short severity, Exception exception)
      Overrides:
      getSeverity in class AbstractLSPErrorReporter
    • getCode

      protected String getCode(String domain, String key, Object[] arguments, Exception exception)
      Overrides:
      getCode in class AbstractLSPErrorReporter
    • toLSPRange

      protected abstract org.eclipse.lsp4j.Range toLSPRange(org.apache.xerces.xni.XMLLocator location, String key, Object[] arguments, String message, org.eclipse.lsp4j.DiagnosticSeverity diagnosticSeverity, boolean fatalError, DOMDocument document, String documentOrGrammarURI, boolean errorForDocument)
    • getReferencedGrammarRange

      protected abstract org.eclipse.lsp4j.Range getReferencedGrammarRange(String grammarURI)