Class JsonProducer

    • Field Detail

      • m_OutputFull

        protected boolean m_OutputFull
        whether to output all values, not just ones that differ from the default values.
    • Constructor Detail

      • JsonProducer

        public JsonProducer()
    • Method Detail

      • setOutputFull

        public void setOutputFull​(boolean value)
        Sets whether to output all values or just ones that differ from the default ones.
        Parameters:
        value - true if all values are to be output
      • getOutputFull

        public boolean getOutputFull()
        Returns whether to output all values or just ones that differ from the default ones.
        Returns:
        true if all values are to be output
      • initOutput

        protected net.minidev.json.JSONObject initOutput()
        Initializes the output data structure.
        Specified by:
        initOutput in class AbstractOptionProducer<net.minidev.json.JSONObject,​Object>
        Returns:
        the created data structure
      • addArray

        protected void addArray​(net.minidev.json.JSONObject obj,
                                String key,
                                Object[] values)
        Adds the array.
        Parameters:
        key - the identifier for the array
        values - the values of the array
      • addArray

        protected void addArray​(String key,
                                Object[] values)
        Adds the array.
        Parameters:
        key - the identifier for the array
        values - the values of the array
      • addArray

        protected void addArray​(AbstractArgumentOption option,
                                String key,
                                Object values)
        Adds the array.
        Parameters:
        option - the associated option
        key - the identifier for the array
        values - the values of the array
      • addPair

        protected void addPair​(String key,
                               Object value)
        Adds the named key/value pair.
        Parameters:
        key - the identifier for the value
        value - the value
      • newObject

        protected net.minidev.json.JSONObject newObject​(Object obj)
        Creates a new JSON object.
        Parameters:
        obj - the object to add to a JSONObject structure
        Returns:
        the JSON object
      • main

        public static void main​(String[] args)
        Executes the producer from commandline.
        Parameters:
        args - the commandline arguments, use -help for help