Package com.structurizr.view
Class ThemeUtils
java.lang.Object
com.structurizr.view.ThemeUtils
Some utility methods for exporting themes to JSON.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
loadThemes
(com.structurizr.Workspace workspace) Loads (and inlines) the element and relationship styles from the themes defined in the workspace, into the workspace itself.static String
toJson
(com.structurizr.Workspace workspace) Serializes the theme (element and relationship styles) in the specified workspace to a JSON string.static void
Serializes the theme (element and relationship styles) in the specified workspace to a file, as a JSON string.
-
Constructor Details
-
ThemeUtils
public ThemeUtils()
-
-
Method Details
-
toJson
Serializes the theme (element and relationship styles) in the specified workspace to a file, as a JSON string.- Parameters:
workspace
- a Workspace objectfile
- a File representing the JSON definition- Throws:
Exception
- if something goes wrong
-
toJson
Serializes the theme (element and relationship styles) in the specified workspace to a JSON string.- Parameters:
workspace
- a Workspace instance- Returns:
- a JSON string
- Throws:
Exception
- if something goes wrong
-
loadThemes
Loads (and inlines) the element and relationship styles from the themes defined in the workspace, into the workspace itself. This implementation simply copies the styles from all themes into the workspace.- Parameters:
workspace
- a Workspace object- Throws:
Exception
- if something goes wrong
-