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 SummaryNested ClassesModifier and TypeClassDescriptionstatic classMay be added to various contexts to offer the Pipeline Groovy link where it is appropriate.static classstatic final classRepresents 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.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionorg.kohsuke.stapler.HttpResponsedoGenerateSnippet(org.kohsuke.stapler.StaplerRequest2 req, String json) getItem(org.kohsuke.stapler.StaplerRequest2 req) getQuasiDescriptors(boolean advanced) Used to generate the list of links on the sidepanel.static StringPublicly accessible version ofobject2Groovy(StringBuilder, Object, boolean)that translates an object into the equivalent Pipeline Groovy string.static Stringobject2Groovy(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.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface hudson.model.DescriptorByNameOwnergetDescriptorByName
- 
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- 
Snippetizerpublic Snippetizer()
 
- 
- 
Method Details- 
object2GroovyPublicly 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
 
- 
object2Groovypublic 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:
- getUrlNamein interface- Action
 
- 
getIconFileName- Specified by:
- getIconFileNamein interface- Action
 
- 
getDisplayName- Specified by:
- getDisplayNamein interface- Action
- Specified by:
- getDisplayNamein 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.StaplerRequest2 req, @QueryParameter String json) throws Exception - Throws:
- Exception
 
- 
getItem@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @CheckForNull public Item getItem(org.kohsuke.stapler.StaplerRequest2 req) 
- 
getSnippetizerLinksUsed to generate the list of links on the sidepanel.
 
-