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
public static class PomModifications.Replacement extends PomModifications.Modification
Replaces the content between the start and end locations with the produced content.
-
-
Constructor Summary
Constructors Constructor Description Replacement(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intapply(BufferedReader in, Writer out, String line)booleanequals(Object obj)Function<String,String>getContentProducer()org.apache.maven.model.InputLocationgetEnd()intgetIndentLvl()-
Methods inherited from class org.technologybrewery.baton.util.pom.PomModifications.Modification
compareTo, getStart
-
-
-
-
Constructor Detail
-
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 Detail
-
getEnd
public org.apache.maven.model.InputLocation getEnd()
-
getIndentLvl
public int getIndentLvl()
-
apply
public int apply(BufferedReader in, Writer out, String line) throws IOException
- Specified by:
applyin classPomModifications.Modification- Throws:
IOException
-
equals
public boolean equals(Object obj)
- Overrides:
equalsin classPomModifications.Modification
-
-