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
Abstract class reporter with referenced grammar.
- Author:
- Angelo ZERR
-
Field Summary
FieldsFields inherited from class org.eclipse.lemminx.extensions.xerces.AbstractLSPErrorReporter
NO_RANGEFields inherited from class org.apache.xerces.impl.XMLErrorReporter
CONTINUE_AFTER_FATAL_ERROR, ERROR_HANDLER, fContinueAfterFatalError, fDefaultErrorHandler, fErrorHandler, fLocale, fLocator, fMessageFormatters, SEVERITY_ERROR, SEVERITY_FATAL_ERROR, SEVERITY_WARNING -
Constructor Summary
ConstructorsConstructorDescriptionAbstractReferencedGrammarLSPErrorReporter(String source, DOMDocument xmlDocument, List<org.eclipse.lsp4j.Diagnostic> diagnostics, ContentModelManager contentModelManager, boolean hasRelatedInformation, Map<String, ReferencedGrammarDiagnosticsInfo> referencedGrammarDiagnosticsInfoCache) -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidfillReferencedGrammarDiagnostic(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.protected Stringprotected StringgetMessage(String domain, String key, Object[] arguments, Exception exception) protected abstract org.eclipse.lsp4j.RangegetReferencedGrammarRange(String grammarURI) protected org.eclipse.lsp4j.DiagnosticSeveritygetSeverity(String domain, String key, Object[] arguments, short severity, Exception exception) protected org.eclipse.lsp4j.RangetoLSPRange(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.RangetoLSPRange(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) Methods inherited from class org.eclipse.lemminx.extensions.xerces.AbstractLSPErrorReporter
addDiagnostic, createDefaultRange, getDOMDocument, initializeReporter, initializeReporter, isIgnoreFatalError, reportError, setCurrentErrorMethods inherited from class org.apache.xerces.impl.XMLErrorReporter
getErrorHandler, getFeature, getFeatureDefault, getLocale, getMessageFormatter, getPropertyDefault, getRecognizedFeatures, getRecognizedProperties, getSAXErrorHandler, putMessageFormatter, removeMessageFormatter, reportError, reportError, reportError, reset, setDocumentLocator, setFeature, setLocale, setProperty
-
Field Details
-
contentModelManager
-
-
Constructor Details
-
AbstractReferencedGrammarLSPErrorReporter
public AbstractReferencedGrammarLSPErrorReporter(String source, DOMDocument xmlDocument, List<org.eclipse.lsp4j.Diagnostic> diagnostics, ContentModelManager contentModelManager, boolean hasRelatedInformation, Map<String, ReferencedGrammarDiagnosticsInfo> referencedGrammarDiagnosticsInfoCache)
-
-
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:
toLSPRangein classAbstractLSPErrorReporter- 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 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.rngCode- the RelaxNG error code and null otherwise.grammarURI- the referenced grammar URI.
-
endReport
public void endReport() -
getMessage
- Overrides:
getMessagein classAbstractLSPErrorReporter
-
getSeverity
protected org.eclipse.lsp4j.DiagnosticSeverity getSeverity(String domain, String key, Object[] arguments, short severity, Exception exception) - Overrides:
getSeverityin classAbstractLSPErrorReporter
-
getCode
- Overrides:
getCodein classAbstractLSPErrorReporter
-
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
-