Package org.openrewrite.java
Class ShortenFullyQualifiedTypeReferences
java.lang.Object
org.openrewrite.Recipe
org.openrewrite.java.ShortenFullyQualifiedTypeReferences
- All Implemented Interfaces:
Cloneable
public class ShortenFullyQualifiedTypeReferences
extends org.openrewrite.Recipe
-
Nested Class Summary
Nested classes/interfaces inherited from class org.openrewrite.Recipe
org.openrewrite.Recipe.Builder, org.openrewrite.Recipe.DelegatingRecipe -
Field Summary
Fields inherited from class org.openrewrite.Recipe
contributors, examples, PANIC -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable DurationJavaVisitor<org.openrewrite.ExecutionContext> static <J2 extends org.openrewrite.java.tree.J>
JavaVisitor<org.openrewrite.ExecutionContext> modifyOnly(J2 subtree) Returns a visitor which replaces all fully qualified references in the given subtree with simple names and adds corresponding import statements.Methods inherited from class org.openrewrite.Recipe
addDataTable, builder, buildRecipeList, causesAnotherCycle, clone, createRecipeDescriptor, equals, getContributors, getDataTableDescriptors, getDescriptor, getExamples, getInstanceName, getInstanceNameSuffix, getJacksonPolymorphicTypeTag, getMaintainers, getName, getRecipeList, getTags, hashCode, maxCycles, noop, onComplete, run, run, run, setContributors, setExamples, validate, validate, validateAll, validateAll
-
Constructor Details
-
ShortenFullyQualifiedTypeReferences
public ShortenFullyQualifiedTypeReferences()
-
-
Method Details
-
getDisplayName
- Specified by:
getDisplayNamein classorg.openrewrite.Recipe
-
getDescription
- Specified by:
getDescriptionin classorg.openrewrite.Recipe
-
getEstimatedEffortPerOccurrence
- Overrides:
getEstimatedEffortPerOccurrencein classorg.openrewrite.Recipe
-
getVisitor
- Overrides:
getVisitorin classorg.openrewrite.Recipe
-
modifyOnly
public static <J2 extends org.openrewrite.java.tree.J> JavaVisitor<org.openrewrite.ExecutionContext> modifyOnly(J2 subtree) Returns a visitor which replaces all fully qualified references in the given subtree with simple names and adds corresponding import statements.For compatibility with other Java-based languages it is recommended to use this as a service via
ImportService.shortenFullyQualifiedTypeReferencesIn(J), as that will dispatch to the correct implementation for the language.- See Also:
-