Class Snippetizer

java.lang.Object
org.jenkinsci.plugins.workflow.cps.Snippetizer
All Implemented Interfaces:
ExtensionPoint, Action, DescriptorByNameOwner, ModelObject, RootAction
Direct Known Subclasses:
Snippetizer.LocalAction

@Extension public class Snippetizer extends Object implements RootAction, DescriptorByNameOwner
Takes a Step as configured through the UI and tries to produce equivalent Groovy code.
  • Field Details

  • Constructor Details

    • Snippetizer

      public Snippetizer()
  • Method Details

    • object2Groovy

      public static String object2Groovy(Object o) throws UnsupportedOperationException
      Publicly accessible version of object2Groovy(StringBuilder, Object, boolean) that translates an object into the equivalent Pipeline Groovy string.
      Parameters:
      o - The object to translate.
      Returns:
      A string translation of the object.
      Throws:
      UnsupportedOperationException
    • object2Groovy

      public static String object2Groovy(Object o, boolean nestedExp) throws UnsupportedOperationException
      Publicly accessible version of object2Groovy(StringBuilder, Object, boolean) that translates an object into the equivalent Pipeline Groovy string.
      Parameters:
      o - The object to translate.
      nestedExp - true if this object is written as a nested expression (in which case we always produce parentheses for readability)
      Returns:
      A string translation of the object.
      Throws:
      UnsupportedOperationException
    • getUrlName

      public String getUrlName()
      Specified by:
      getUrlName in interface Action
    • getIconFileName

      public String getIconFileName()
      Specified by:
      getIconFileName in interface Action
    • getDisplayName

      public String getDisplayName()
      Specified by:
      getDisplayName in interface Action
      Specified by:
      getDisplayName in interface ModelObject
    • getQuasiDescriptors

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public Collection<Snippetizer.QuasiDescriptor> getQuasiDescriptors(boolean advanced)
    • getGlobalVariables

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public Iterable<GlobalVariable> getGlobalVariables()
    • doGenerateSnippet

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) public org.kohsuke.stapler.HttpResponse doGenerateSnippet(org.kohsuke.stapler.StaplerRequest req, @QueryParameter String json) throws Exception
      Throws:
      Exception
    • getItem

      @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @CheckForNull public Item getItem(org.kohsuke.stapler.StaplerRequest req)
    • getSnippetizerLinks

      @NonNull public List<SnippetizerLink> getSnippetizerLinks()
      Used to generate the list of links on the sidepanel.