Class JSONMaker

java.lang.Object
se.datadosen.jalbum.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)
    Sample config file content: {"paging":10, "include":["shopOptions","userVariables"]}
  • Method Summary

    Modifier and Type Method Description
    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
    java.lang.String[] getIncludes()  
    int getPaging()  
    MyJSONObject getTree​(AlbumObject rootFolder)  
    java.lang.String getTreeAsString​(AlbumObject rootFolder)  
    boolean isMakeTree()  
    void makeDeepJSONData​(java.io.File outputDir)
    Make one huge deep-data.json file in root of album based upon data.json files in subfolders
    void setIncludes​(java.lang.String[] includes)
    List AlbumObject variables to add to the generated JSON data
    void setMakeTree​(boolean makeTree)  
    void setPaging​(int paging)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • JSONMaker

      public JSONMaker​(AlbumBean engine)
    • JSONMaker

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

    • 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