Class PolyglotRecipe


  • public class PolyglotRecipe
    extends Recipe
    • Constructor Detail

      • PolyglotRecipe

        public PolyglotRecipe​(java.lang.String name,
                              org.graalvm.polyglot.Value value)
    • Method Detail

      • getName

        public java.lang.String getName()
        Overrides:
        getName in class Recipe
      • getCategoryDescriptors

        public java.util.List<CategoryDescriptor> getCategoryDescriptors()
      • getNamedStyles

        public java.util.List<NamedStyles> getNamedStyles()
      • getDisplayName

        public java.lang.String getDisplayName()
        Description copied from class: Recipe
        A human-readable display name for the recipe, initial capped with no period. For example, "Find text". The display name can be assumed to be rendered in documentation and other places where markdown is understood, so it is possible to use stylistic markers like backticks to indicate types. For example, "Find uses of `java.util.List`".
        Specified by:
        getDisplayName in class Recipe
        Returns:
        The display name.
      • getDescription

        public java.lang.String getDescription()
        Description copied from class: Recipe
        A human-readable description for the recipe, consisting of one or more full sentences ending with a period.

        "Find methods by pattern." is an example. The description can be assumed to be rendered in documentation and other places where markdown is understood, so it is possible to use stylistic markers like backticks to indicate types. For example, "Find uses of `java.util.List`.".

        Overrides:
        getDescription in class Recipe
        Returns:
        The display name.
      • getTags

        public java.util.Set<java.lang.String> getTags()
        Description copied from class: Recipe
        A set of strings used for categorizing related recipes. For example "testing", "junit", "spring". Tags should not include information about the language(s) this recipe is applicable to. See Recipe.getLanguages() instead. Any individual tag should consist of a single word, all lowercase.
        Overrides:
        getTags in class Recipe
        Returns:
        The tags.
      • getApplicableTest

        @Nullable
        protected @Nullable TreeVisitor<?,​ExecutionContext> getApplicableTest()
        Description copied from class: Recipe
        A recipe can optionally include an applicability test that can be used to determine whether it should run on a set of source files (or even be listed in a suggested list of recipes for a particular codebase).

        To identify a tree as applicable, the visitor should mark or otherwise any tree at any level. Any mutation that the applicability test visitor makes to a tree will not included in the results.

        Overrides:
        getApplicableTest in class Recipe
        Returns:
        A tree visitor that performs an applicability test.
      • getSingleSourceApplicableTest

        @Nullable
        protected @Nullable TreeVisitor<?,​ExecutionContext> getSingleSourceApplicableTest()
        Description copied from class: Recipe
        A recipe can optionally include an applicability test that can be used to determine whether it should run on a particular source file.

        To identify a SourceFile as applicable, the visitor should mark it at any level. Any mutation that the applicability test visitor makes on the tree will not included in the results.

        The applicability test only affects whether this recipes Recipe.getVisitor() will run. Downstream Recipe.doNext(Recipe) will still run.

        Overrides:
        getSingleSourceApplicableTest in class Recipe
        Returns:
        A tree visitor that performs an applicability test.
      • getVisitor

        protected TreeVisitor<?,​ExecutionContext> getVisitor()
        Description copied from class: Recipe
        A recipe can optionally encasulate a visitor that performs operations on a set of source files. Subclasses of the recipe may override this method to provide an instance of a visitor that will be used when the recipe is executed.
        Overrides:
        getVisitor in class Recipe
        Returns:
        A tree visitor that will perform operations associated with the recipe.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object