Package org.eclipse.xtext.formatting2
Interface ITextReplacer
-
- All Known Subinterfaces:
ICompositeTextReplacer
- All Known Implementing Classes:
AbstractTextReplacer
,CommentReplacer
,ConditionalReplacer
,FilteredSubDocument
,HiddenRegionReplacer
,MaxLineWidthDocument
,MultilineCommentReplacer
,SinglelineCodeCommentReplacer
,SinglelineCommentReplacer
,SinglelineDocCommentReplacer
,SubDocument
,WhitespaceReplacer
public interface ITextReplacer
A TextReplacer is responsible for a
text region
inside aIFormattableDocument
and producesreplacements
for that region.The
IFormattableDocument
ensures that replacers are executed in the correct order, i.e. from the beginning of the document to the end of the document.- Since:
- 2.8
-
-
Field Summary
Fields Modifier and Type Field Description static com.google.common.base.Function<ITextReplacer,ITextSegment>
GET_REGION
A function that maps a given replacer to the region that it replaces.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ITextReplacerContext
createReplacements(ITextReplacerContext context)
Creates the real replacements for this region.ITextSegment
getRegion()
The region this replace is responsible for.
-
-
-
Field Detail
-
GET_REGION
static final com.google.common.base.Function<ITextReplacer,ITextSegment> GET_REGION
A function that maps a given replacer to the region that it replaces.
-
-
Method Detail
-
getRegion
ITextSegment getRegion()
The region this replace is responsible for. All text replacements create by this replacer must be inside this region.
-
createReplacements
ITextReplacerContext createReplacements(ITextReplacerContext context)
Creates the real replacements for this region. The given context may be altered and returned afterwards.
-
-