Package org.eclipse.lemminx.services.extensions.commands

## Class AbstractDOMDocumentCommandHandler

- java.lang.Object
- - org.eclipse.lemminx.services.extensions.commands.AbstractDOMDocumentCommandHandler

All Implemented Interfaces:
  `IXMLCommandService.IDelegateCommandHandler`

Direct Known Subclasses:
  `AssociateGrammarCommand`, `CheckBoundGrammarCommand`, `MinifyDocumentCommand`, `SurroundWithCommand`, `XMLValidationFileCommand`

    public abstract class AbstractDOMDocumentCommandHandler
    extends Object
    implements IXMLCommandService.IDelegateCommandHandler

Abstract command to work with a given `DOMDocument` filled in the first argument of the command as `TextDocumentIdentifier`.

Author:
  Angelo ZERR

### Constructor Summary

Constructors
`AbstractDOMDocumentCommandHandler​(IXMLDocumentProvider documentProvider)`

### Method Summary

All Methods Instance Methods Abstract Methods Concrete Methods
`protected abstract Object` `executeCommand​(DOMDocument document, org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)` Executes a command
`Object` `executeCommand​(org.eclipse.lsp4j.ExecuteCommandParams params, SharedSettings sharedSettings, org.eclipse.lsp4j.jsonrpc.CancelChecker cancelChecker)` Executes a command

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### 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.IDelegateCommandHandler`
Executes a command

Specified by:
  `executeCommand` in interface `IXMLCommandService.IDelegateCommandHandler`
Parameters:
  `params` - command execution parameters
  `sharedSettings` - the shared settings.
  `cancelChecker` - check if cancel has been requested
Returns:
  the result of the command
Throws:
  `Exception` - the unhandled exception will be wrapped in `org.eclipse.lsp4j.jsonrpc.ResponseErrorException` and 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 the `TextDocumentIdentifier` argument.
  `params` - command execution parameters
  `sharedSettings` - the shared settings
  `cancelChecker` - check if cancel has been requested
Returns:
  the result of the command
Throws:
  `Exception` - the unhandled exception will be wrapped in `org.eclipse.lsp4j.jsonrpc.ResponseErrorException` and be wired back to the JSON-RPC protocol caller