Package org.eclipse.lemminx.commons

## Class TextDocuments<T extends TextDocument>

- java.lang.Object
- - org.eclipse.lemminx.commons.TextDocuments<T>

Direct Known Subclasses:
  `ModelTextDocuments`

    public class TextDocuments<T extends TextDocument>
    extends Object

A manager for simple text documents

### Constructor Summary

Constructors
`TextDocuments()`

### Method Summary

All Methods Instance Methods Concrete Methods
`Collection<T>` `all()` Returns the all opened documents.
`T` `createDocument​(org.eclipse.lsp4j.TextDocumentItem document)`
`T` `get​(String uri)` Returns the document for the given URI.
`T` `get​(org.eclipse.lsp4j.TextDocumentIdentifier documentIdentifier)`
`boolean` `isIncremental()` Returns true if text document is managed in incremental mode and false otherwise.
`T` `onDidChangeTextDocument​(org.eclipse.lsp4j.DidChangeTextDocumentParams params)`
`T` `onDidCloseTextDocument​(org.eclipse.lsp4j.DidCloseTextDocumentParams params)`
`T` `onDidOpenTextDocument​(org.eclipse.lsp4j.DidOpenTextDocumentParams params)`
`void` `setIncremental​(boolean incremental)` Set the incremental support.

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

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

### Constructor Detail

#### TextDocuments

    public TextDocuments()

### Method Detail

#### setIncremental

    public void setIncremental​(boolean incremental)

Set the incremental support.

Parameters:
  `incremental` -

#### isIncremental

    public boolean isIncremental()

Returns true if text document is managed in incremental mode and false otherwise.

Returns:
  true if text document is managed in incremental mode and false otherwise.

#### get

    public T get​(org.eclipse.lsp4j.TextDocumentIdentifier documentIdentifier)

#### get

    public T get​(String uri)

Returns the document for the given URI. Returns undefined if the document is not mananged by this instance.

Parameters:
  `uri` - The text document's URI to retrieve.
Returns:
  the text document or `undefined`.

#### createDocument

    public T createDocument​(org.eclipse.lsp4j.TextDocumentItem document)

#### onDidChangeTextDocument

    public T onDidChangeTextDocument​(org.eclipse.lsp4j.DidChangeTextDocumentParams params)

#### onDidOpenTextDocument

    public T onDidOpenTextDocument​(org.eclipse.lsp4j.DidOpenTextDocumentParams params)

#### onDidCloseTextDocument

    public T onDidCloseTextDocument​(org.eclipse.lsp4j.DidCloseTextDocumentParams params)

#### all

    public Collection<T> all()

Returns the all opened documents.

Returns:
  the all opened documents.