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
Nested 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.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier 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.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getUrlNamein interfaceAction
-
getIconFileName
- Specified by:
getIconFileNamein interfaceAction
-
getDisplayName
- Specified by:
getDisplayNamein interfaceAction- Specified by:
getDisplayNamein 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.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) -
getSnippetizerLinks
Used to generate the list of links on the sidepanel.
-