Class PomModifications.Replacement
java.lang.Object
org.technologybrewery.baton.util.pom.PomModifications.Modification
org.technologybrewery.baton.util.pom.PomModifications.Replacement
- All Implemented Interfaces:
Comparable<PomModifications.Modification>
- Enclosing class:
- PomModifications
Replaces the content between the start and end locations with the produced content.
-
Constructor Summary
ConstructorsConstructorDescriptionReplacement(org.apache.maven.model.InputLocation start, org.apache.maven.model.InputLocation end, int indentLvl, UnaryOperator<String> contentProducer) Constructor for multi-line replacements.Replacement(org.apache.maven.model.InputLocation start, org.apache.maven.model.InputLocation end, String content) Constructor for replacing content within a single line. -
Method Summary
Modifier and TypeMethodDescriptionintapply(BufferedReader in, Writer out, String line) booleanorg.apache.maven.model.InputLocationgetEnd()intMethods inherited from class org.technologybrewery.baton.util.pom.PomModifications.Modification
compareTo, getStart
-
Constructor Details
-
Replacement
public Replacement(org.apache.maven.model.InputLocation start, org.apache.maven.model.InputLocation end, String content) Constructor for replacing content within a single line.- Parameters:
start- the location to insert the new content.end- the location to skip to, existing content between start and end will be deleted.content- the new content.
-
Replacement
public Replacement(org.apache.maven.model.InputLocation start, org.apache.maven.model.InputLocation end, int indentLvl, UnaryOperator<String> contentProducer) Constructor for multi-line replacements.- Parameters:
start- the location to insert the new content.end- the location to skip to, existing content between start and end will be deleted.indentLvl- the indent level of the current content on the line.contentProducer- a function that produces the content to insert, given a one-level indent string.
-
-
Method Details
-
getEnd
public org.apache.maven.model.InputLocation getEnd() -
getContentProducer
-
getIndentLvl
public int getIndentLvl() -
apply
- Specified by:
applyin classPomModifications.Modification- Throws:
IOException
-
equals
- Overrides:
equalsin classPomModifications.Modification
-