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 ITextReplacerA TextReplacer is responsible for a
text regioninside aIFormattableDocumentand producesreplacementsfor that region.The
IFormattableDocumentensures 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_REGIONA 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 ITextReplacerContextcreateReplacements(ITextReplacerContext context)Creates the real replacements for this region.ITextSegmentgetRegion()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.
-
-