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
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
     
    @Nullable Duration
     
    JavaVisitor<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

    Methods inherited from class java.lang.Object

    finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ShortenFullyQualifiedTypeReferences

      public ShortenFullyQualifiedTypeReferences()
  • Method Details

    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in class org.openrewrite.Recipe
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in class org.openrewrite.Recipe
    • getEstimatedEffortPerOccurrence

      public @Nullable Duration getEstimatedEffortPerOccurrence()
      Overrides:
      getEstimatedEffortPerOccurrence in class org.openrewrite.Recipe
    • getVisitor

      public JavaVisitor<org.openrewrite.ExecutionContext> getVisitor()
      Overrides:
      getVisitor in class org.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: