Interface JsonSettings


public interface JsonSettings
Settings for json output rendering. The current default version is version 1.0. CAUTION: This class is still in development and may change drastically without any further notice.
Since:
5.2.190507
  • Field Details

    • VERSION_1_0

      static final String VERSION_1_0
      JSON Format-Version 1.0. The first released version.
      Since:
      5.2.191206
      See Also:
    • VERSION_1_1

      static final String VERSION_1_1
      JSON Format-Version 1.1. This version introduces Full PageRef Rendering, which outputs the PageRef entirely and references the page instead of copying most of the Page attributes.
      Since:
      5.2.200205
      See Also:
    • VERSION_1_2

      static final String VERSION_1_2
      JSON Format-Version 1.2. This version introduces dom property config rendering
      Since:
      5.2.210904
      See Also:
  • Method Details

    • isPrettyPrinting

      @ApiDoc(since="5.2.190507", comment="Retrieve the pretty printing setting for json output.") boolean isPrettyPrinting()
      Returns the prettyPrinting setting.
      Returns:
      true if pretty printing is enabled, false otherwise
      Since:
      5.2.190507
    • setPrettyPrinting

      @NotNull @ApiDoc(since="5.2.190507", comment="Switch pretty printing on/off.") @NotNull JsonSettings setPrettyPrinting(boolean value)
      Turns the prettyPrinting setting on or off. If pretty printing is set to false no whitespaces will be added, making it the best option for data transfers. If pretty printing is true then the json output will be rendered more readable for humans using indentations and other whitespace for the json output.
      Parameters:
      value - the new setting for prettyPrinting
      Since:
      5.2.190507
    • getFormatVersion

      @ApiDoc(since="5.2.191206", comment="Retrieve the current json format version.") @NotNull @NotNull String getFormatVersion()
      Returns the json format setting.
      Returns:
      the numeric json format version
      Since:
      5.2.191206
    • setFormatVersion

      @ApiDoc(since="5.2.191206", comment="Set the json format version string.") @NotNull @NotNull JsonSettings setFormatVersion(@NotNull @NotNull String formatVersion)
      Sets the json format version for rendering. Different json formats may structure data differently.
      Since:
      5.2.191206
    • isSectionTemplateRendering

      @ApiDoc(since="5.2.191206", comment="Retrieve the SectionTemplateRendering setting for json output.") boolean isSectionTemplateRendering()
      Returns the section template rendering setting.
      Returns:
      true if section template rendering is enabled, false otherwise
      Since:
      5.2.191206
    • setSectionTemplateRendering

      @ApiDoc(since="5.2.191206", comment="Set section template rendering on/off.") @NotNull @NotNull JsonSettings setSectionTemplateRendering(boolean sectionTemplateRendering)
      Turns the template rendering for Section type elements on or off. If template rendering is set totrue the template of every Section is evaluated and the template result is the json output.If section template rendering is false the default section rendering will be active and render the section as a simple JsonObject with its form data.
      Parameters:
      sectionTemplateRendering - the value to set
      Since:
      5.2.191206
    • isMetaDataRendering

      @ApiDoc(since="5.2.191206", comment="Retrieve the MetaDataRendering setting for json output.") boolean isMetaDataRendering()
      Returns the meta FormData rendering setting.
      Returns:
      true if meta data rendering is enabled, false otherwise
      Since:
      5.2.191206
    • setMetaDataRendering

      @ApiDoc(since="5.2.191206", comment="Set meta data rendering on/off.") @NotNull @NotNull JsonSettings setMetaDataRendering(boolean metaDataRendering)
      Turns the meta data for elements on or off. If meta data rendering is true the json output will contain a 'metaFormData' attribute containing the meta data.
      Parameters:
      metaDataRendering - the value to set
      Since:
      5.2.191206
    • setDataRenderDepth

      @NotNull @ApiDoc(since="5.2.191206", comment="Set the renderdepth for datasets.") @NotNull JsonSettings setDataRenderDepth(int dataRenderDepth)
      Sets the render depth of linked Datasets in the JsonOutput.
      • 0: all Dataset instances in the output are rendered as a reference
      • 1: Dataset instances in the output are rendered in full but Datasets in the hierarchy arerendered as reference
      • 2: Dataset instances in the output hierarchy that have two or more Dataset parents are renderedas a reference... and so on
      Parameters:
      dataRenderDepth - the value to set
      Since:
      5.2.191206
    • getDataRenderDepth

      @ApiDoc(since="5.2.191206", comment="Retrieve the renderdepth for datasets.") int getDataRenderDepth()
      Returns the set data render depth.
      Returns:
      the set data render depth
      Since:
      5.2.191206
    • setOutputLengthLimit

      @Experimental JsonSettings setOutputLengthLimit(int limit)
      Set the length limit of the generated JSON output. If the limit is exceeded, the JSON rendering will throw an IOException. The default limit is Integer.MAX_VALUE.
      Parameters:
      limit - The length limit for the generated JSON output.
      Since:
      5.2.230506
    • getOutputLenthLimit

      @Experimental int getOutputLenthLimit()
      Get the length limit of the generated JSON output. If the limit is exceeded, an exception will be thrown. The default limit is Integer.MAX_VALUE.
      Returns:
      The length limit for the generated JSON output.
      Since:
      5.2.230506
    • setNonDisplayedSectionsRendering

      void setNonDisplayedSectionsRendering(boolean shouldRenderNonDisplayedSections)
      Sets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non-displayed Section should be rendered
      Parameters:
      shouldRenderNonDisplayedSections - true non displayed Section will be included in JSON-Output
      Since:
      5.2.210102
    • getNonDisplayedSectionsRendering

      boolean getNonDisplayedSectionsRendering()
      Gets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non displayed Section should be rendered
      Returns:
      true non displayed Section will be included in JSON-Output
      Since:
      5.2.210102
    • setMetaInheritanceRendering

      void setMetaInheritanceRendering(boolean metaInheritanceRendering)
      Activates or deactivates the rendering of inherited meta data values. If this setting is set to true, the rendered meta data will include values from the parent hierarchy. If this setting is set to false, only the meta data from the current element will be rendered.
      Parameters:
      metaInheritanceRendering -
      Since:
      5.2.210409
    • isMetaInheritanceRendering

      boolean isMetaInheritanceRendering()
      Gets the current MetaInheritanceRendering-Setting
      Returns:
      metaInheritanceRendering
      Since:
      5.2.210409