Package processing.mode.java.preproc
Class RewriteResultBuilder
java.lang.Object
processing.mode.java.preproc.RewriteResultBuilder
Builder to help create a {RewriteResult}.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEdit(TextTransform.Edit edit) Record an edit made during rewrite.voidaddOffset(int offset) Indicate that lines were added to the sketch.build()Build a new rewrite result.getEdits()Get the edits generated during rewrite.intGet the number of lines written.
-
Constructor Details
-
RewriteResultBuilder
public RewriteResultBuilder()Create a new rewrite result builder.
-
-
Method Details
-
addOffset
public void addOffset(int offset) Indicate that lines were added to the sketch.- Parameters:
offset- By how much to change the current offset.
-
addEdit
Record an edit made during rewrite.- Parameters:
edit- The edit made.
-
getLineOffset
public int getLineOffset()Get the number of lines written.- Returns:
- The offset to add to current preprocessor offset.
-
getEdits
Get the edits generated during rewrite.- Returns:
- The edits generated during rewrite.
-
build
Build a new rewrite result.- Returns:
- Immutable rewrite result.
-