Package org.eclipse.lemminx.commons
Class ModelTextDocument<T>
- java.lang.Object
-
- org.eclipse.lsp4j.TextDocumentItem
-
- org.eclipse.lemminx.commons.TextDocument
-
- org.eclipse.lemminx.commons.ModelTextDocument<T>
-
- Type Parameters:
T- the model type (ex : DOM Document)
public class ModelTextDocument<T> extends TextDocument
ATextDocumentwhich is associate to a model loaded in async.- Author:
- Angelo ZERR
-
-
Constructor Summary
Constructors Constructor Description ModelTextDocument(String text, String uri, BiFunction<TextDocument,org.eclipse.lsp4j.jsonrpc.CancelChecker,T> parse)ModelTextDocument(org.eclipse.lsp4j.TextDocumentItem document, BiFunction<TextDocument,org.eclipse.lsp4j.jsonrpc.CancelChecker,T> parse)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TgetExistingModel()Returns the existing parsed model synchronized with last version of the text document and null otherwise.TgetModel()Returns the parsed model synchronized with last version of the text document.voidsetText(String text)voidsetVersion(int version)-
Methods inherited from class org.eclipse.lemminx.commons.TextDocument
getWordRangeAt, isIncremental, lineAt, lineDelimiter, lineOffsetAt, lineText, offsetAt, positionAt, setIncremental, update
-
-
-
-
Constructor Detail
-
ModelTextDocument
public ModelTextDocument(org.eclipse.lsp4j.TextDocumentItem document, BiFunction<TextDocument,org.eclipse.lsp4j.jsonrpc.CancelChecker,T> parse)
-
ModelTextDocument
public ModelTextDocument(String text, String uri, BiFunction<TextDocument,org.eclipse.lsp4j.jsonrpc.CancelChecker,T> parse)
-
-
Method Detail
-
getExistingModel
public T getExistingModel()
Returns the existing parsed model synchronized with last version of the text document and null otherwise.- Returns:
- the existing parsed model synchronized with last version of the text document and null otherwise.
-
getModel
public T getModel()
Returns the parsed model synchronized with last version of the text document.- Returns:
- the parsed model synchronized with last version of the text document.
-
setText
public void setText(String text)
- Overrides:
setTextin classorg.eclipse.lsp4j.TextDocumentItem
-
setVersion
public void setVersion(int version)
- Overrides:
setVersionin classorg.eclipse.lsp4j.TextDocumentItem
-
-