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 Summary
Fields Modifier and Type Field Description protected ContentModelManagercontentModelManager-
Fields inherited from class org.eclipse.lemminx.extensions.xerces.AbstractLSPErrorReporter
NO_RANGE
-
-
Constructor Summary
Constructors Constructor Description AbstractReferencedGrammarLSPErrorReporter(String source, DOMDocument xmlDocument, List<org.eclipse.lsp4j.Diagnostic> diagnostics, ContentModelManager contentModelManager, boolean hasRelatedInformation, Map<String,ReferencedGrammarDiagnosticsInfo> referencedGrammarDiagnosticsInfoCache)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidendReport()protected 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 StringgetCode(String domain, String key, Object[] arguments, Exception exception)protected 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, setCurrentError
-
Methods 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 Detail
-
contentModelManager
protected final ContentModelManager contentModelManager
-
-
Constructor Detail
-
AbstractReferencedGrammarLSPErrorReporter
public AbstractReferencedGrammarLSPErrorReporter(String source, DOMDocument xmlDocument, List<org.eclipse.lsp4j.Diagnostic> diagnostics, ContentModelManager contentModelManager, boolean hasRelatedInformation, Map<String,ReferencedGrammarDiagnosticsInfo> referencedGrammarDiagnosticsInfoCache)
-
-
Method Detail
-
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
protected String getMessage(String domain, String key, Object[] arguments, Exception exception)
- Overrides:
getMessagein classAbstractLSPErrorReporter
-
getSeverity
protected org.eclipse.lsp4j.DiagnosticSeverity getSeverity(String domain, String key, Object[] arguments, short severity, Exception exception)
- Overrides:
getSeverityin classAbstractLSPErrorReporter
-
getCode
protected String getCode(String domain, String key, Object[] arguments, Exception exception)
- 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
protected abstract org.eclipse.lsp4j.Range getReferencedGrammarRange(String grammarURI)
-
-