Class diagram JSON generator. More...
Class diagram JSON generator.
Definition at line 63 of file class_diagram_generator.h.
#include <class_diagram_generator.h>
Public Member Functions | |
generator (diagram_config &config, diagram_model &model) | |
void | generate_diagram (nlohmann::json &parent) const override |
Main generator method. | |
void | generate (const class_ &c, nlohmann::json &parent) const |
void | generate (const objc_interface &c, nlohmann::json &parent) const |
void | generate (const enum_ &c, nlohmann::json &parent) const |
void | generate (const concept_ &c, nlohmann::json &parent) const |
void | generate (const package &p, nlohmann::json &parent) const |
void | generate_top_level_elements (nlohmann::json &parent) const |
In a nested diagram, generate the top level elements. | |
void | generate_relationships (nlohmann::json &parent) const |
Generate all relationships in the diagram. | |
template<typename T > | |
void | generate_relationships (const T &c, nlohmann::json &parent) const |
Generate all relationships originating at a diagram element. | |
template<> | |
void | generate_relationships (const package &p, nlohmann::json &parent) const |
template<> | |
void | generate_relationships (const package &p, nlohmann::json &parent) const |
Public Member Functions inherited from clanguml::common::generators::json::generator< ConfigType, DiagramType > | |
~generator () override=default | |
void | generate (std::ostream &ostr) const override |
Generate diagram. | |
virtual void | generate_diagram (nlohmann::json &parent) const =0 |
Generate diagram model. | |
void | generate_metadata (nlohmann::json &parent) const |
Generate metadata element with diagram metadata. | |
Public Member Functions inherited from clanguml::common::generators::generator< ConfigType, DiagramType > | |
generator (ConfigType &config, DiagramType &model) | |
Constructor. | |
virtual | ~generator ()=default |
virtual void | generate (std::ostream &ostr) const =0 |
Generate diagram. | |
const ConfigType & | config () const |
Get reference to diagram config. | |
const DiagramType & | model () const |
Get reference to diagram model. | |
std::optional< std::pair< std::string, std::string > > | get_link_pattern (const common::model::source_location &sl) const |
std::optional< std::pair< std::string, std::string > > | get_tooltip_pattern (const common::model::source_location &sl) const |
std::optional< std::string > | render_link (const common::model::diagram_element &e) const |
std::optional< std::string > | render_link (const common::model::relationship &e) const |
std::optional< std::string > | render_tooltip (const common::model::diagram_element &e) const |
std::optional< std::string > | render_tooltip (const common::model::relationship &e) const |
void | init_context () |
Initialize diagram Jinja context. | |
void | update_context () const |
Update diagram Jinja context. | |
void | init_env () |
const inja::json & | context () const |
inja::Environment & | env () const |
Additional Inherited Members | |
Protected Attributes inherited from clanguml::common::generators::generator< ConfigType, DiagramType > | |
inja::json | m_context |
inja::Environment | m_env |
clanguml::class_diagram::generators::json::generator::generator | ( | diagram_config & | config, |
diagram_model & | model | ||
) |
Definition at line 179 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate | ( | const class_ & | c, |
nlohmann::json & | parent | ||
) | const |
Render class element into a JSON node.
c | class diagram element |
parent | JSON node |
Definition at line 260 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate | ( | const concept_ & | c, |
nlohmann::json & | parent | ||
) | const |
Render concept element into a JSON node.
c | concept diagram element |
parent | JSON node |
Definition at line 296 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate | ( | const enum_ & | c, |
nlohmann::json & | parent | ||
) | const |
Render enum element into a JSON node.
c | enum diagram element |
parent | JSON node |
Definition at line 286 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate | ( | const objc_interface & | c, |
nlohmann::json & | parent | ||
) | const |
Render ObjC interface or protocol element into a JSON node.
c | enum diagram element |
parent | JSON node |
Definition at line 306 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate | ( | const package & | p, |
nlohmann::json & | parent | ||
) | const |
Render package element into a JSON node.
p | package diagram element |
parent | JSON node |
Definition at line 216 of file class_diagram_generator.cc.
|
overridevirtual |
Main generator method.
This method is called first and coordinates the entire diagram generation.
ostr | Output stream. |
Implements clanguml::common::generators::json::generator< ConfigType, DiagramType >.
Definition at line 184 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate_relationships | ( | const package & | p, |
nlohmann::json & | parent | ||
) | const |
Definition at line 334 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate_relationships | ( | const package & | p, |
nlohmann::json & | parent | ||
) | const |
void clanguml::class_diagram::generators::json::generator::generate_relationships | ( | const T & | c, |
nlohmann::json & | parent | ||
) | const |
Generate all relationships originating at a diagram element.
T | Type of diagram element |
c | Diagram diagram element |
parent | JSON node |
Definition at line 149 of file class_diagram_generator.h.
void clanguml::class_diagram::generators::json::generator::generate_relationships | ( | nlohmann::json & | parent | ) | const |
Generate all relationships in the diagram.
parent | JSON node |
Definition at line 320 of file class_diagram_generator.cc.
void clanguml::class_diagram::generators::json::generator::generate_top_level_elements | ( | nlohmann::json & | parent | ) | const |
In a nested diagram, generate the top level elements.
This method iterates over the top level elements. In case the diagram is nested (i.e. includes packages), for each package it recursively call generation of elements contained in each package.
parent | JSON node |
Definition at line 202 of file class_diagram_generator.cc.