Class JSONMaker


  • public class JSONMaker
    extends java.lang.Object
    Create JSON formatted data out of album object metadata
    Since:
    13
    • Constructor Summary

      Constructors 
      Constructor Description
      JSONMaker​(AlbumBean engine)  
      JSONMaker​(AlbumBean engine, java.io.File configFile, int level)
      Sample config file content: {"paging":10, "include":["shopOptions","userVariables"]}
    • Constructor Detail

      • JSONMaker

        public JSONMaker​(AlbumBean engine)
      • JSONMaker

        public JSONMaker​(AlbumBean engine,
                         java.io.File configFile,
                         int level)
                  throws java.io.FileNotFoundException,
                         java.io.IOException
        Sample config file content: {"paging":10, "include":["shopOptions","userVariables"]}
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
    • Method Detail

      • getPaging

        public int getPaging()
      • setPaging

        public void setPaging​(int paging)
      • isMakeTree

        public boolean isMakeTree()
      • setMakeTree

        public void setMakeTree​(boolean makeTree)
      • getIncludes

        public java.lang.String[] getIncludes()
      • setIncludes

        public void setIncludes​(java.lang.String[] includes)
        List AlbumObject variables to add to the generated JSON data
        Parameters:
        includes -
      • forEach

        public void forEach​(java.util.function.BiConsumer<AlbumObject,​MyJSONObject> consumer)
        Visit all AlbumObjects that take part in generation of JSON data tree and apply consumer on each
        Parameters:
        consumer - Consumer that takes the current AlbumObject and resulting JSON node as parameter
        Since:
        15.4
      • getTreeAsString

        public java.lang.String getTreeAsString​(AlbumObject rootFolder)
                                         throws java.io.IOException
        Throws:
        java.io.IOException
      • getTree

        public MyJSONObject getTree​(AlbumObject rootFolder)
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • makeDeepJSONData

        public void makeDeepJSONData​(java.io.File outputDir)
                              throws java.io.IOException
        Make one huge deep-data.json file in root of album based upon data.json files in subfolders
        Parameters:
        outputDir -
        Throws:
        java.io.IOException
        Since:
        16.0.1