public final class WorkspaceUtils
extends java.lang.Object
| Constructor | Description |
|---|---|
WorkspaceUtils() |
| Modifier and Type | Method | Description |
|---|---|---|
static com.structurizr.Workspace |
fromJson(java.lang.String json) |
Converts the specified JSON string to a Workspace instance.
|
static com.structurizr.Workspace |
loadWorkspaceFromJson(java.io.File file) |
Loads a workspace from a JSON definition saved as a file.
|
static void |
printWorkspaceAsJson(com.structurizr.Workspace workspace) |
Prints a workspace as JSON to stdout - useful for debugging purposes.
|
static void |
saveWorkspaceToJson(com.structurizr.Workspace workspace,
java.io.File file) |
Saves a workspace to a JSON definition as a file.
|
static java.lang.String |
toJson(com.structurizr.Workspace workspace,
boolean indentOutput) |
Serializes the specified workspace to a JSON string.
|
public static com.structurizr.Workspace loadWorkspaceFromJson(java.io.File file)
throws java.lang.Exception
file - a File representing the JSON definitionjava.lang.Exception - if something goes wrongpublic static void saveWorkspaceToJson(com.structurizr.Workspace workspace,
java.io.File file)
throws java.lang.Exception
workspace - a Workspace objectfile - a File representing the JSON definitionjava.lang.Exception - if something goes wrongpublic static void printWorkspaceAsJson(com.structurizr.Workspace workspace)
workspace - the workspace to printpublic static java.lang.String toJson(com.structurizr.Workspace workspace,
boolean indentOutput)
throws java.lang.Exception
workspace - a Workspace instanceindentOutput - whether to indent the output (prettify)java.lang.Exception - if something goes wrongpublic static com.structurizr.Workspace fromJson(java.lang.String json)
throws java.lang.Exception
json - the JSON definition of the workspacejava.lang.Exception - if the JSON can not be deserialized