Class CheckBoundGrammarCommand
- java.lang.Object
-
- org.eclipse.lemminx.services.extensions.commands.AbstractDOMDocumentCommandHandler
-
- org.eclipse.lemminx.extensions.contentmodel.commands.CheckBoundGrammarCommand
-
- All Implemented Interfaces:
IXMLCommandService.IDelegateCommandHandler
public class CheckBoundGrammarCommand extends AbstractDOMDocumentCommandHandler
XML Command "xml.check.bound.grammar" to verify if an XML document already has a bound grammar/schema, opened from the command palette.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCOMMAND_ID
-
Constructor Summary
Constructors Constructor Description CheckBoundGrammarCommand(IXMLDocumentProvider documentProvider)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static booleancanBindWithGrammar(DOMDocument document)Returns true if the given DOM document can be bound with a given grammar and false otherwise.protected ObjectexecuteCommand(DOMDocument document, org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)Executes a command-
Methods inherited from class org.eclipse.lemminx.services.extensions.commands.AbstractDOMDocumentCommandHandler
executeCommand
-
-
-
-
Field Detail
-
COMMAND_ID
public static final String COMMAND_ID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
CheckBoundGrammarCommand
public CheckBoundGrammarCommand(IXMLDocumentProvider documentProvider)
-
-
Method Detail
-
executeCommand
protected Object executeCommand(DOMDocument document, org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) throws Exception
Description copied from class:AbstractDOMDocumentCommandHandlerExecutes a command- Specified by:
executeCommandin classAbstractDOMDocumentCommandHandler- Parameters:
document- the DOM document retrieve by theTextDocumentIdentifierargument.params- command execution parameterssharedSettings- the shared settingscancelChecker- check if cancel has been requested- Returns:
- the result of the command
- Throws:
Exception- the unhandled exception will be wrapped inorg.eclipse.lsp4j.jsonrpc.ResponseErrorExceptionand be wired back to the JSON-RPC protocol caller
-
canBindWithGrammar
public static boolean canBindWithGrammar(DOMDocument document)
Returns true if the given DOM document can be bound with a given grammar and false otherwise.- Parameters:
document- the DOM document.- Returns:
- true if the given DOM document can be bound with a given grammar and false otherwise.
-
-