public class DocumentRewriter
extends java.lang.Object
DocumentRewriter.Section
s allow to modify the document's text with the
IAppendable
API.
The caller must hold a
IReadAccess.readOnly(org.eclipse.xtext.util.concurrent.IUnitOfWork)
lock
during the whole lifecycle of an instance.Modifier and Type | Class and Description |
---|---|
static class |
DocumentRewriter.Factory |
static class |
DocumentRewriter.Section |
Modifier | Constructor and Description |
---|---|
protected |
DocumentRewriter(IXtextDocument document,
XtextResource resource,
DocumentRewriter.Factory factory) |
Modifier and Type | Method and Description |
---|---|
protected void |
addSection(DocumentRewriter.Section newSection) |
protected DocumentSourceAppender.Factory.OptionalParameters |
createOptionalParameters() |
java.util.List<ReplaceRegion> |
getChanges() |
IXtextDocument |
getDocument() |
protected RewritableImportSection |
getImportSection() |
java.lang.String |
getIndentString() |
java.lang.String |
getLineSeparator() |
DocumentRewriter.Section |
newSection(int offset,
int length) |
DocumentRewriter.Section |
newSection(int offset,
int length,
boolean ensureEmptyLinesAround) |
DocumentRewriter.Section |
newSection(int offset,
int length,
int baseIndentationLevel,
boolean ensureEmptyLinesAround) |
protected DocumentRewriter(IXtextDocument document, XtextResource resource, DocumentRewriter.Factory factory)
public IXtextDocument getDocument()
protected RewritableImportSection getImportSection()
public java.util.List<ReplaceRegion> getChanges()
public DocumentRewriter.Section newSection(int offset, int length)
public DocumentRewriter.Section newSection(int offset, int length, boolean ensureEmptyLinesAround)
public DocumentRewriter.Section newSection(int offset, int length, int baseIndentationLevel, boolean ensureEmptyLinesAround)
protected DocumentSourceAppender.Factory.OptionalParameters createOptionalParameters()
protected void addSection(DocumentRewriter.Section newSection)
public java.lang.String getLineSeparator()
public java.lang.String getIndentString()