Class MermaidContentTransformer
- java.lang.Object
-
- org.eclipse.epsilon.picto.transformers.MermaidContentTransformer
-
- All Implemented Interfaces:
ViewContentTransformer
public class MermaidContentTransformer extends java.lang.Object implements ViewContentTransformer
-
-
Constructor Summary
Constructors Constructor Description MermaidContentTransformer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canTransform(ViewContent content)
java.lang.String
getLabel(ViewContent content)
protected static ExternalContentTransformation
mermaid(java.nio.file.Path mmd, java.lang.String ext)
static java.nio.file.Path
mermaidToImage(java.lang.String mmd, java.lang.String ext)
static java.nio.file.Path
mermaidToImage(java.nio.file.Path mmd, java.lang.String ext)
static java.lang.String
mermaidToRawSvg(java.lang.String mmd)
static java.lang.String
mermaidToRawSvg(java.nio.file.Path mmd)
ViewContent
transform(ViewContent content, PictoView pictoView)
-
-
-
Method Detail
-
canTransform
public boolean canTransform(ViewContent content)
- Specified by:
canTransform
in interfaceViewContentTransformer
-
getLabel
public java.lang.String getLabel(ViewContent content)
- Specified by:
getLabel
in interfaceViewContentTransformer
-
transform
public ViewContent transform(ViewContent content, PictoView pictoView) throws java.lang.Exception
- Specified by:
transform
in interfaceViewContentTransformer
- Throws:
java.lang.Exception
-
mermaidToRawSvg
public static java.lang.String mermaidToRawSvg(java.lang.String mmd) throws java.io.IOException
- Parameters:
mmd
- The Mermaid as plain text.- Returns:
- The SVG as an XML string.
- Throws:
java.io.IOException
-
mermaidToRawSvg
public static java.lang.String mermaidToRawSvg(java.nio.file.Path mmd) throws java.io.IOException
- Parameters:
mmd
- The Mermaid file.- Returns:
- The SVG as an XML string.
- Throws:
java.io.IOException
-
mermaidToImage
public static java.nio.file.Path mermaidToImage(java.lang.String mmd, java.lang.String ext) throws java.io.IOException
- Parameters:
mmd
- The Mermaid as plain text.ext
- The output file extension.- Returns:
- The image as a file.
- Throws:
java.io.IOException
-
mermaidToImage
public static java.nio.file.Path mermaidToImage(java.nio.file.Path mmd, java.lang.String ext) throws java.io.IOException
- Parameters:
mmd
- The Mermaid file.ext
- The output file extension.- Returns:
- The path to the output file.
- Throws:
java.io.IOException
- If invoking the CLI tool goes wrong.
-
mermaid
protected static ExternalContentTransformation mermaid(java.nio.file.Path mmd, java.lang.String ext)
-
-