Class AbstractDOMDocumentCommandHandler
- java.lang.Object
-
- org.eclipse.lemminx.services.extensions.commands.AbstractDOMDocumentCommandHandler
-
- All Implemented Interfaces:
IXMLCommandService.IDelegateCommandHandler
- Direct Known Subclasses:
AssociateGrammarCommand,CheckBoundGrammarCommand,SurroundWithCommand,XMLValidationFileCommand
public abstract class AbstractDOMDocumentCommandHandler extends Object implements IXMLCommandService.IDelegateCommandHandler
Abstract command to work with a givenDOMDocumentfilled in the first argument of the command asTextDocumentIdentifier.- Author:
- Angelo ZERR
-
-
Constructor Summary
Constructors Constructor Description AbstractDOMDocumentCommandHandler(IXMLDocumentProvider documentProvider)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract ObjectexecuteCommand(DOMDocument document, org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)Executes a commandObjectexecuteCommand(org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)Executes a command
-
-
-
Constructor Detail
-
AbstractDOMDocumentCommandHandler
public AbstractDOMDocumentCommandHandler(IXMLDocumentProvider documentProvider)
-
-
Method Detail
-
executeCommand
public final Object executeCommand(org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) throws Exception
Description copied from interface:IXMLCommandService.IDelegateCommandHandlerExecutes a command- Specified by:
executeCommandin interfaceIXMLCommandService.IDelegateCommandHandler- Parameters:
params- command execution parameterssharedSettings- the shared settings.cancelChecker- 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
-
executeCommand
protected abstract Object executeCommand(DOMDocument document, org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker) throws Exception
Executes a command- 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
-
-