Package org.openrewrite.maven
Class MavenTagInsertionComparator
java.lang.Object
org.openrewrite.maven.MavenTagInsertionComparator
- All Implemented Interfaces:
Comparator<org.openrewrite.xml.tree.Content>
public class MavenTagInsertionComparator
extends Object
implements Comparator<org.openrewrite.xml.tree.Content>
Helps to insert a new POM element in the most idiomatic
place possible while preserving the existing order of the already
present elements.
So we'll prefer to insert a dependencies block after GAV coordinates, SCM, properties, but before plugins. "After" ordering preference takes priority over "before".
-
Constructor Summary
ConstructorsConstructorDescriptionMavenTagInsertionComparator(List<? extends org.openrewrite.xml.tree.Content> existingTags) -
Method Summary
Modifier and TypeMethodDescriptionintcompare(org.openrewrite.xml.tree.Content c1, org.openrewrite.xml.tree.Content c2) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
MavenTagInsertionComparator
-
-
Method Details
-
compare
public int compare(org.openrewrite.xml.tree.Content c1, org.openrewrite.xml.tree.Content c2) - Specified by:
comparein interfaceComparator<org.openrewrite.xml.tree.Content>
-