Package com.structurizr.view
Class ThemeUtils
- java.lang.Object
-
- com.structurizr.view.ThemeUtils
-
public final class ThemeUtils extends java.lang.ObjectSome utility methods for exporting themes to JSON.
-
-
Constructor Summary
Constructors Constructor Description ThemeUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidloadThemes(com.structurizr.Workspace workspace)Loads (and inlines) the element and relationship styles from the themes defined in the workspace, into the workspace itself.static java.lang.StringtoJson(com.structurizr.Workspace workspace)Serializes the theme (element and relationship styles) in the specified workspace to a JSON string.static voidtoJson(com.structurizr.Workspace workspace, java.io.File file)Serializes the theme (element and relationship styles) in the specified workspace to a file, as a JSON string.
-
-
-
Method Detail
-
toJson
public static void toJson(com.structurizr.Workspace workspace, java.io.File file) throws java.lang.ExceptionSerializes 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:
java.lang.Exception- if something goes wrong
-
toJson
public static java.lang.String toJson(com.structurizr.Workspace workspace) throws java.lang.ExceptionSerializes the theme (element and relationship styles) in the specified workspace to a JSON string.- Parameters:
workspace- a Workspace instance- Returns:
- a JSON string
- Throws:
java.lang.Exception- if something goes wrong
-
loadThemes
public static void loadThemes(com.structurizr.Workspace workspace) throws java.lang.ExceptionLoads (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:
java.lang.Exception- if something goes wrong
-
-