Class XMLValidationSettings
java.lang.Object
org.eclipse.lemminx.extensions.contentmodel.settings.XMLValidationSettings
- Direct Known Subclasses:
XMLValidationFilter,XMLValidationRootSettings
XML validation settings for a given file.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanorg.eclipse.lsp4j.PublishDiagnosticsCapabilitiesReturns the XML Namespaces validation settings.static org.eclipse.lsp4j.DiagnosticSeveritygetNoGrammarSeverity(XMLValidationSettings validationSettings) Returns thenoGrammarseverity according the given settings andDiagnosticSeverity.Hintotherwise.Returns the XML Schema validation settings.Returns true if xi:include is to be validated and false otherwise.inthashCode()booleanReturns true if a fatal error is thrown if the incoming document contains a DOCTYPE declaration and false otherwise.booleanReturns true if the validation is enabled and false otherwise.booleanbooleanReturns true if external entities must be resolved and false otherwise.booleanisTagSupported(org.eclipse.lsp4j.DiagnosticTag tag) Returnstrueif the client advertises support for the givenDiagnosticTagin itspublishDiagnosticscapabilities.merge(XMLValidationSettings settings) voidsetCapabilities(org.eclipse.lsp4j.PublishDiagnosticsCapabilities publishDiagnostics) voidsetDisallowDocTypeDecl(boolean disallowDocTypeDecl) Set true if a fatal error is thrown if the incoming document contains a DOCTYPE declaration and false otherwise.voidsetEnabled(boolean enabled) Set true if the validation is enabled and false otherwise.voidsetNamespaces(XMLNamespacesSettings namespaces) Set the XML Namespaces validation settings.voidsetNoGrammar(String noGrammar) voidsetResolveExternalEntities(boolean resolveExternalEntities) Set true if external entities must be resolved and false otherwise.voidsetSchema(XMLSchemaSettings schema) Set the XML Schema validation settings.voidsetXInclude(XMLXIncludeSettings xInclude) Set true if xi:include is to be validated and false otherwise.
-
Constructor Details
-
XMLValidationSettings
public XMLValidationSettings()
-
-
Method Details
-
isEnabled
public boolean isEnabled()Returns true if the validation is enabled and false otherwise.- Returns:
- true if the validation is enabled and false otherwise.
-
setEnabled
public void setEnabled(boolean enabled) Set true if the validation is enabled and false otherwise.- Parameters:
enabled- true if the validation is enabled and false otherwise.
-
getNamespaces
Returns the XML Namespaces validation settings.- Returns:
- the XML Namespaces validation settings.
-
setNamespaces
Set the XML Namespaces validation settings.- Parameters:
namespaces- the XML Namespaces validation settings.
-
getSchema
Returns the XML Schema validation settings.- Returns:
- the XML Schema validation settings.
-
setSchema
Set the XML Schema validation settings.- Parameters:
schema- the XML Schema validation settings.
-
setNoGrammar
-
getNoGrammar
-
isDisallowDocTypeDecl
public boolean isDisallowDocTypeDecl()Returns true if a fatal error is thrown if the incoming document contains a DOCTYPE declaration and false otherwise.- Returns:
- true if a fatal error is thrown if the incoming document contains a DOCTYPE declaration and false otherwise.
-
setDisallowDocTypeDecl
public void setDisallowDocTypeDecl(boolean disallowDocTypeDecl) Set true if a fatal error is thrown if the incoming document contains a DOCTYPE declaration and false otherwise.- Parameters:
disallowDocTypeDecl- disallow DOCTYPE declaration.
-
isResolveExternalEntities
public boolean isResolveExternalEntities()Returns true if external entities must be resolved and false otherwise.- Returns:
- true if external entities must be resolved and false otherwise.
-
setResolveExternalEntities
public void setResolveExternalEntities(boolean resolveExternalEntities) Set true if external entities must be resolved and false otherwise.- Parameters:
resolveExternalEntities- resolve external entities
-
getXInclude
Returns true if xi:include is to be validated and false otherwise.- Returns:
- true if xi:include is to be validated and false otherwise.
-
setXInclude
Set true if xi:include is to be validated and false otherwise.- Parameters:
xInclude- xi:include
-
getNoGrammarSeverity
public static org.eclipse.lsp4j.DiagnosticSeverity getNoGrammarSeverity(XMLValidationSettings validationSettings) Returns thenoGrammarseverity according the given settings andDiagnosticSeverity.Hintotherwise.- Parameters:
validationSettings- the validation settings- Returns:
- the
noGrammarseverity according the given settings andDiagnosticSeverity.Hintotherwise.
-
merge
-
setCapabilities
public void setCapabilities(org.eclipse.lsp4j.PublishDiagnosticsCapabilities publishDiagnostics) -
getCapabilities
public org.eclipse.lsp4j.PublishDiagnosticsCapabilities getCapabilities() -
isRelatedInformation
public boolean isRelatedInformation() -
isTagSupported
public boolean isTagSupported(org.eclipse.lsp4j.DiagnosticTag tag) Returnstrueif the client advertises support for the givenDiagnosticTagin itspublishDiagnosticscapabilities.Use cases:
- RNC validation: checking whether the client supports
DiagnosticTag.Unnecessaryso that unused defines can be rendered with a fade-out effect instead of a plain warning - XML validation: checking
DiagnosticTag.Deprecatedsupport before tagging diagnostics for deprecated elements or attributes
- Parameters:
tag- the diagnostic tag to check for client support.- Returns:
trueif the client supports the given tag,falseotherwise.
- RNC validation: checking whether the client supports
-
hashCode
public int hashCode() -
equals
-