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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
Returns the set data render depth.@NotNull String
Returns the json format setting.boolean
Gets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non displayedSection
should be renderedint
Get the length limit of the generated JSON output.boolean
Returns the metaFormData
rendering setting.boolean
Gets the current MetaInheritanceRendering-Settingboolean
Returns the prettyPrinting setting.boolean
Returns the section template rendering setting.@NotNull JsonSettings
setDataRenderDepth
(int dataRenderDepth) Sets the render depth of linkedDataset
s in theJsonOutput
.@NotNull JsonSettings
setFormatVersion
(@NotNull String formatVersion) Sets the json format version for rendering.@NotNull JsonSettings
setMetaDataRendering
(boolean metaDataRendering) Turns the meta data for elements on or off.void
setMetaInheritanceRendering
(boolean metaInheritanceRendering) Activates or deactivates the rendering of inherited meta data values.void
setNonDisplayedSectionsRendering
(boolean shouldRenderNonDisplayedSections) Sets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non-displayedSection
should be renderedsetOutputLengthLimit
(int limit) Set the length limit of the generated JSON output.@NotNull JsonSettings
setPrettyPrinting
(boolean value) Turns the prettyPrinting setting on or off.@NotNull JsonSettings
setSectionTemplateRendering
(boolean sectionTemplateRendering) Turns the template rendering forSection
type 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:
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 tofalse
no whitespaces will be added, making it the best option for data transfers. If pretty printing istrue
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 forSection
type elements on or off. If template rendering is set totrue
the template of everySection
is evaluated and the template result is the json output.If section template rendering isfalse
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 metaFormData
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 istrue
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) - 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
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-displayedSection
should be rendered- Parameters:
shouldRenderNonDisplayedSections
-true
non displayedSection
will be included in JSON-Output- Since:
- 5.2.210102
-
getNonDisplayedSectionsRendering
boolean getNonDisplayedSectionsRendering()Gets the NonDisplayedSectionsRendering-parameter NonDisplayedSectionsRendering indicates whether non displayedSection
should be rendered- Returns:
true
non displayedSection
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 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
boolean isMetaInheritanceRendering()Gets the current MetaInheritanceRendering-Setting- Returns:
- metaInheritanceRendering
- Since:
- 5.2.210409
-