Class PreProcessor


  • public class PreProcessor
    extends Object
    This is a pre-processor for JSON objects. The contract of this is as follows. A JSON object may have an attribute that is one of these directives, the argument is then applied.

    Example

         {
             "foo":"bar",
             "#import":"id"
         }
     
    This means that the JSON with "id" is imported and

    Created by Jeff Gaynor
    on 2/15/19 at 4:11 PM

    • Field Detail

      • IMPORT_DIRECTIVE

        public static String IMPORT_DIRECTIVE
    • Method Detail

      • execute

        protected net.sf.json.JSON execute​(net.sf.json.JSONArray array,
                                           Set<String> ids)
        This will track the ids and throw an exception if there is cycle.
        Parameters:
        array -
        ids -
        Returns:
      • execute

        public net.sf.json.JSON execute​(net.sf.json.JSONArray array)
      • execute

        public net.sf.json.JSON execute​(net.sf.json.JSONObject object)
      • execute

        public net.sf.json.JSON execute​(net.sf.json.JSONObject object,
                                        Set<String> ids)