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 booleancanTransform(ViewContent content)java.lang.StringgetLabel(ViewContent content)protected static ExternalContentTransformationmermaid(java.nio.file.Path mmd, java.lang.String ext)static java.nio.file.PathmermaidToImage(java.lang.String mmd, java.lang.String ext)static java.nio.file.PathmermaidToImage(java.nio.file.Path mmd, java.lang.String ext)static java.lang.StringmermaidToRawSvg(java.lang.String mmd)static java.lang.StringmermaidToRawSvg(java.nio.file.Path mmd)ViewContenttransform(ViewContent content, PictoView pictoView)
-
-
-
Method Detail
-
canTransform
public boolean canTransform(ViewContent content)
- Specified by:
canTransformin interfaceViewContentTransformer
-
getLabel
public java.lang.String getLabel(ViewContent content)
- Specified by:
getLabelin interfaceViewContentTransformer
-
transform
public ViewContent transform(ViewContent content, PictoView pictoView) throws java.lang.Exception
- Specified by:
transformin 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)
-
-