Class JsonStateSection
java.lang.Object
com.scivicslab.turingworkflow.plugins.report.sections.basic.JsonStateSection
- All Implemented Interfaces:
SectionBuilder
POJO section builder that outputs an actor's JsonState in YAML format.
Pure business logic - no CallableByActionName.
Use JsonStateSectionActor to expose as an actor.
- Since:
- 2.16.0
- Author:
- devteam@scivicslab.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongenerate()Generates the section content.getTitle()Returns the section title.voidsetActorName(String actorName) Sets the actor name (for display in title).voidsetJsonPath(String jsonPath) Sets the JSON path filter (optional).voidsetYamlContent(String yamlContent) Sets the YAML content to output.
-
Constructor Details
-
JsonStateSection
public JsonStateSection()
-
-
Method Details
-
setActorName
Sets the actor name (for display in title).- Parameters:
actorName- the actor name
-
setYamlContent
Sets the YAML content to output.- Parameters:
yamlContent- the YAML-formatted JsonState content
-
setJsonPath
Sets the JSON path filter (optional).- Parameters:
jsonPath- the JSON path filter, or null for entire state
-
generate
Generates the section content.Generates a
[JsonState: <actorName>]block containing the YAML content. If a JSON path filter is set, it is appended to the title as(path: <jsonPath>). Returns an empty string if no YAML content has been set.- Specified by:
generatein interfaceSectionBuilder- Returns:
- the formatted JsonState section content, or empty string if no content
-
getTitle
Returns the section title.If null or empty, the section content is output without a title line.
Always returns
nullbecause the title is embedded within the generated content.- Specified by:
getTitlein interfaceSectionBuilder- Returns:
- the section title, or null for no title
-