Class Snippetizer
java.lang.Object
org.jenkinsci.plugins.workflow.cps.Snippetizer
- All Implemented Interfaces:
ExtensionPoint
,Action
,DescriptorByNameOwner
,ModelObject
,RootAction
- Direct Known Subclasses:
Snippetizer.LocalAction
Takes a
Step
as configured through the UI and tries to produce equivalent Groovy code.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
May be added to various contexts to offer the Pipeline Groovy link where it is appropriate.static class
static final class
Represents a step or other step-like objects that should appear inSnippetizer
’s main dropdown list and can generate some fragment of Pipeline script.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.kohsuke.stapler.HttpResponse
doGenerateSnippet
(org.kohsuke.stapler.StaplerRequest req, String json) getItem
(org.kohsuke.stapler.StaplerRequest req) getQuasiDescriptors
(boolean advanced) Used to generate the list of links on the sidepanel.static String
Publicly accessible version ofobject2Groovy(StringBuilder, Object, boolean)
that translates an object into the equivalent Pipeline Groovy string.static String
object2Groovy
(Object o, boolean nestedExp) Publicly accessible version ofobject2Groovy(StringBuilder, Object, boolean)
that translates an object into the equivalent Pipeline Groovy string.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface hudson.model.DescriptorByNameOwner
getDescriptorByName
-
Field Details
-
ACTION_URL
- See Also:
-
GENERATE_URL
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final String GENERATE_URL- See Also:
-
-
Constructor Details
-
Snippetizer
public Snippetizer()
-
-
Method Details
-
object2Groovy
Publicly accessible version ofobject2Groovy(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 ofobject2Groovy(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
- Specified by:
getUrlName
in interfaceAction
-
getIconFileName
- Specified by:
getIconFileName
in interfaceAction
-
getDisplayName
- Specified by:
getDisplayName
in interfaceAction
- Specified by:
getDisplayName
in interfaceModelObject
-
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
Used to generate the list of links on the sidepanel.
-