Context¶
-
public class
Context
¶ Contains AST nodes created from Coco files. A context is the main container for AST nodes created from Coco models.
Constructors¶
Methods¶
generate¶
-
public boolean
generate
(io.cocotec.coco.platform.coco.CodeGenerationLanguage language, String outputDirectory)¶ Generates code from all modules that are currently loaded.
Returns: true on error. Diagnostics will have been created on failure.
generateArchitectureDiagram¶
-
public io.cocotec.coco.platform.coco.ArchitectureDiagram
generateArchitectureDiagram
(io.cocotec.coco.platform.coco.Node node, String font, boolean componentNames, boolean componentTypes, boolean portNames, boolean portTypes, boolean hidePorts, int depth)¶ Generates an SVG diagram of a component, recursively showing subcomponents.
generateArchitectureDiagramAsync¶
-
public void
generateArchitectureDiagramAsync
(io.cocotec.coco.platform.coco.ArchitectureDiagramHandle listener, io.cocotec.coco.platform.coco.Node node, String font, boolean componentNames, boolean componentTypes, boolean portNames, boolean portTypes, boolean hidePorts, int depth)¶ Generates an SVG diagram of a component, recursively showing subcomponents, without blocking. Both the listener and the canceller must be kept alive until the listener receives a value. Upon cancellation, the listener will still receive a value.
generateComponentSummary¶
generateStateDiagramGraph¶
-
public io.cocotec.coco.platform.coco.StateDiagram
generateStateDiagramGraph
(io.cocotec.coco.platform.coco.Node node, boolean collapseEdges, boolean hideTransitionLabels)¶ Generate dot graph(s) of any state machines found under the specified node. Returns an empty string if no state machines are found.
graphvizFonts¶
importedModules¶
injectStylesIntoStateDiagramSvg¶
-
public String
injectStylesIntoStateDiagramSvg
(String diagramSvg)¶ Inject Coco CSS styling into the given state machine diagram generated by generate_state_diagram_graph() and rendered by ‘dot’ into an SVG graphics. The CSS styling text will be injected along with an enclosing style element directly after the first svg element opening. Returns a copy of the given SVG with the CSS injected or the empty string if the injecting failed.
loadedModules¶
maxArchitectureDiagramDepth¶
nodePosition¶
recommendedArchitectureDiagramDepth¶
-
public int
recommendedArchitectureDiagramDepth
(io.cocotec.coco.platform.coco.Node node)¶ Recommends a depth limit for a component to avoid the diagram being overwhelming. This can be useful to avoid slow render times for very large diagrams. For flat architectures, it errs on the side of caution and recommends showing too little detail instead of too much.