Interface JsonSettings
public interface JsonSettings
Settings for json output rendering. The current default version is
version 1.0.- Since:
- 5.2.190507
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionintReturns the set data render depth.@NotNull StringReturns the json format setting.@NotNull JsonMetaDataRenderModeGets the currentJsonMetaDataRenderModebooleanGets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non displayedSectionshould be renderedintGet the length limit of the generated JSON output.booleanDeprecated.booleanDeprecated.since 5.2.250404 - usegetMetaDataRenderMode()booleanReturns the prettyPrinting setting.booleanReturns the section template rendering setting.@NotNull JsonSettingssetDataRenderDepth(int dataRenderDepth) Sets the render depth of linkedDatasets in the JSON output.@NotNull JsonSettingssetFormatVersion(@NotNull String formatVersion) Sets the json format version for rendering.@NotNull JsonSettingssetMetaDataRendering(boolean metaDataRendering) Deprecated.since 5.2.250404 - usesetMetaDataRenderMode(JsonMetaDataRenderMode)setMetaDataRenderMode(@NotNull JsonMetaDataRenderMode renderMode) Sets the currentJsonMetaDataRenderModesetMetaDataRenderMode(@NotNull String renderMode) Sets the currentJsonMetaDataRenderModevoidsetMetaInheritanceRendering(boolean metaInheritanceRendering) Deprecated.since 5.2.250404 - usesetMetaDataRenderMode(JsonMetaDataRenderMode)voidsetNonDisplayedSectionsRendering(boolean shouldRenderNonDisplayedSections) Sets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non-displayedSectionshould be renderedsetOutputLengthLimit(int limit) Set the length limit of the generated JSON output.@NotNull JsonSettingssetPrettyPrinting(boolean value) Turns the prettyPrinting setting on or off.@NotNull JsonSettingssetSectionTemplateRendering(boolean sectionTemplateRendering) Turns the template rendering forSectiontype elements on or off.
-
Field Details
-
VERSION_1_0
JSON Format-Version 1.0. The first released version.- Since:
- 5.2.191206
- See Also:
-
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
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:
trueif pretty printing is enabled,falseotherwise- 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 tofalseno whitespaces will be added, making it the best option for data transfers. If pretty printing istruethen 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:
trueif section template rendering is enabled,falseotherwise- 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 forSectiontype elements on or off. If template rendering is set totruethe template of everySectionis evaluated and the template result is the json output. If section template rendering isfalsethe 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.") @Deprecated boolean isMetaDataRendering()Deprecated.since 5.2.250404 - usegetMetaDataRenderMode()Returns the metaFormDatarendering setting.- Returns:
trueif meta data rendering is enabled,falseotherwise- Since:
- 5.2.191206
-
setMetaDataRendering
@ApiDoc(since="5.2.191206", comment="Set meta data rendering on/off.") @NotNull @Deprecated @NotNull JsonSettings setMetaDataRendering(boolean metaDataRendering) Deprecated.since 5.2.250404 - usesetMetaDataRenderMode(JsonMetaDataRenderMode)Turns the meta data for elements on or off. If meta data rendering istruethe 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 linkedDatasets in the JSON output.
- 0: all
Datasetinstances in the output are rendered as a reference - 1:
Datasetinstances in the output are rendered in full but Datasets in the hierarchy are rendered as reference - 2:
Datasetinstances in the output hierarchy that have two or more Dataset parents are rendered as a reference... and so on
- Parameters:
dataRenderDepth- the value to set- Since:
- 5.2.191206
- 0: all
-
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
Set the length limit of the generated JSON output. If the limit is exceeded, the JSON rendering will throw anIOException. The default limit isInteger.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 isInteger.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-displayedSectionshould be rendered- Parameters:
shouldRenderNonDisplayedSections-truenon displayedSectionwill be included in JSON-Output- Since:
- 5.2.210102
-
getNonDisplayedSectionsRendering
boolean getNonDisplayedSectionsRendering()Gets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non displayedSectionshould be rendered- Returns:
truenon displayedSectionwill be included in JSON-Output- Since:
- 5.2.210102
-
setMetaInheritanceRendering
Deprecated.since 5.2.250404 - usesetMetaDataRenderMode(JsonMetaDataRenderMode)Activates or deactivates the rendering of inherited meta data values. If this setting is set totrue, the rendered meta data will include values from the parent hierarchy. If this setting is set tofalse, only the meta data from the current element will be rendered.- Parameters:
metaInheritanceRendering-- Since:
- 5.2.210409
-
isMetaInheritanceRendering
Deprecated.since 5.2.250404 - usegetMetaDataRenderMode()Gets the current MetaInheritanceRendering-Setting- Returns:
- metaInheritanceRendering
- Since:
- 5.2.210409
-
getMetaDataRenderMode
Gets the currentJsonMetaDataRenderMode- Returns:
- The
JsonMetaDataRenderMode - Since:
- 5.2.250404
-
setMetaDataRenderMode
Sets the currentJsonMetaDataRenderMode- Parameters:
renderMode- TheJsonMetaDataRenderMode- Since:
- 5.2.250404
-
setMetaDataRenderMode
Sets the currentJsonMetaDataRenderMode- Parameters:
renderMode- The name for theJsonMetaDataRenderMode- Since:
- 5.2.250404
-
getMetaDataRenderMode()