Class WriteJSONStep

  • All Implemented Interfaces:
    ExtensionPoint, Describable<org.jenkinsci.plugins.workflow.steps.Step>

    public class WriteJSONStep
    extends org.jenkinsci.plugins.workflow.steps.Step
    Writes a JSON object to file in the current working directory.
    Author:
    Nikolas Falco
    • Constructor Detail

      • WriteJSONStep

        @DataBoundConstructor
        public WriteJSONStep​(Object json)
    • Method Detail

      • getFile

        public String getFile()
        Returns the name of the file to write.
        Returns:
        the file name
      • setFile

        @DataBoundSetter
        public void setFile​(String file)
      • getJson

        public Object getJson()
        Return the JSON object to save.

        If it is not a JSON object, JSONObject.fromObject(Object) will be used in a first step.

        Returns:
        an object
      • getPretty

        public int getPretty()
        Return the number of spaces used to prettify the JSON dump.
        Returns:
        a int
      • isReturnText

        public boolean isReturnText()
      • setReturnText

        @DataBoundSetter
        public void setReturnText​(boolean returnText)
      • start

        public org.jenkinsci.plugins.workflow.steps.StepExecution start​(org.jenkinsci.plugins.workflow.steps.StepContext context)
                                                                 throws Exception
        Specified by:
        start in class org.jenkinsci.plugins.workflow.steps.Step
        Throws:
        Exception