public abstract class AbstractReferencedGrammarLSPErrorReporter extends AbstractLSPErrorReporter
Modifier and Type | Field and Description |
---|---|
protected ContentModelManager |
contentModelManager |
NO_RANGE
Constructor and Description |
---|
AbstractReferencedGrammarLSPErrorReporter(String source,
DOMDocument xmlDocument,
List<org.eclipse.lsp4j.Diagnostic> diagnostics,
ContentModelManager contentModelManager,
boolean hasRelatedInformation,
Map<String,ReferencedGrammarDiagnosticsInfo> referencedGrammarDiagnosticsInfoCache) |
Modifier and Type | Method and Description |
---|---|
void |
endReport() |
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,
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.
|
protected String |
getCode(String domain,
String key,
Object[] arguments,
Exception exception) |
protected String |
getMessage(String domain,
String key,
Object[] arguments,
Exception exception) |
protected abstract org.eclipse.lsp4j.Range |
getReferencedGrammarRange(String grammarURI) |
protected org.eclipse.lsp4j.DiagnosticSeverity |
getSeverity(String domain,
String key,
Object[] arguments,
short severity,
Exception exception) |
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.
|
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) |
addDiagnostic, createDefaultRange, getDOMDocument, initializeReporter, initializeReporter, isIgnoreFatalError, reportError
getErrorHandler, getFeature, getFeatureDefault, getLocale, getMessageFormatter, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, getSAXErrorHandler, putMessageFormatter, removeMessageFormatter, reportError, reportError, reportError, reset, setDocumentLocator, setFeature, setLocale, setProperty
protected final ContentModelManager contentModelManager
public AbstractReferencedGrammarLSPErrorReporter(String source, DOMDocument xmlDocument, List<org.eclipse.lsp4j.Diagnostic> diagnostics, ContentModelManager contentModelManager, boolean hasRelatedInformation, Map<String,ReferencedGrammarDiagnosticsInfo> referencedGrammarDiagnosticsInfoCache)
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)
toLSPRange
in class AbstractLSPErrorReporter
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.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, String grammarURI)
location
- the Xerces location.key
- the Xerces error keyarguments
- the Xerces error argumentsmessage
- the Xerces error messagediagnosticSeverity
- the the Xerces severityfatalError
- resolverExtensionManager
- the resolversyntaxCode
- the Syntax error code and null otherwise.dtdCode
- the DTD error code and null otherwise.xsdCode
- the XSD error code and null otherwise.grammarURI
- the referenced grammar URI.public void endReport()
protected String getMessage(String domain, String key, Object[] arguments, Exception exception)
getMessage
in class AbstractLSPErrorReporter
protected org.eclipse.lsp4j.DiagnosticSeverity getSeverity(String domain, String key, Object[] arguments, short severity, Exception exception)
getSeverity
in class AbstractLSPErrorReporter
protected String getCode(String domain, String key, Object[] arguments, Exception exception)
getCode
in class AbstractLSPErrorReporter
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)
protected abstract org.eclipse.lsp4j.Range getReferencedGrammarRange(String grammarURI)
Copyright © 2022. All rights reserved.