Interface Editor
- All Known Implementing Classes:
DefaultEditor
,FingerprintingEditor
public interface Editor
API for simple edition of text files like docker files.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Restricts edition to lines after the given line.void
Restricts edition to lines before the given line.void
Inserts the provided lines after the current lower bound.void
Replaces lines matching the current lower and upper bounds with the provided replacement.void
Replaces lines matching the current lower and upper bounds with the replacement, if they match the line pattern.void
replaceRegex
(String regex, String replacement) Replaces strings matching the current lower and upper bounds with the replacement, if they match the line pattern.
-
Method Details
-
after
Restricts edition to lines after the given line.- Parameters:
line
- the marker lineaction
- the action to execute
-
before
Restricts edition to lines before the given line.- Parameters:
line
- the marker lineaction
- the action to execute
-
replace
Replaces lines matching the current lower and upper bounds with the provided replacement.- Parameters:
replacement
- the replacement
-
replace
Replaces lines matching the current lower and upper bounds with the replacement, if they match the line pattern.- Parameters:
line
- the line patternreplacement
- the replacement
-
replaceRegex
Replaces strings matching the current lower and upper bounds with the replacement, if they match the line pattern.- Parameters:
regex
- the regex to look forreplacement
- the replacement
-
insert
Inserts the provided lines after the current lower bound.- Parameters:
lines
- the lines to be inserted
-