Package org.openrewrite.java
Class OrderImports
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.java.OrderImports
- All Implemented Interfaces:
Cloneable
public class OrderImports
extends org.openrewrite.Recipe
This recipe will group and order the imports for a compilation unit using the rules defined by an
ImportLayoutStyle
.
If a style has not been defined, this recipe will use the default import layout style that is modelled after
IntelliJ's default import settings.
The @{link removeUnused
} flag (which is defaulted to true) can be used to also remove any
imports that are not referenced within the compilation unit.
-
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.openrewrite.TreeVisitor<?,
org.openrewrite.ExecutionContext> Methods inherited from class org.openrewrite.Recipe
addDataTable, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getEstimatedEffortPerOccurrence, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll
-
Constructor Details
-
OrderImports
public OrderImports()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayName
in classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescription
in classorg.openrewrite.Recipe
-
getVisitor
public org.openrewrite.TreeVisitor<?,org.openrewrite.ExecutionContext> getVisitor()- Overrides:
getVisitor
in classorg.openrewrite.Recipe
-