Package net.sourceforge.plantuml.api.v2
Interface DiagramReturn
-
public interface DiagramReturnProvides an interface to retrieve the results of a diagram processing operation. This interface allows for obtaining either aDiagramobject if the operation was successful, or an error message if the operation failed, along with the line number where the error occurred.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.awt.image.BufferedImageasImage()Converts the generated diagram to an image representation.java.lang.Stringerror()Retrieves the error message associated with the diagram processing operation.DiagramgetDiagram()Retrieves theDiagramgenerated by the diagram processing operation.java.util.Optional<java.lang.Integer>getErrorLine()Retrieves the line number where an error occurred during the diagram processing operation.java.lang.ThrowablegetRootCause()Retrieves the root cause of the error occurred during the diagram processing operation.
-
-
-
Method Detail
-
getDiagram
Diagram getDiagram()
Retrieves theDiagramgenerated by the diagram processing operation.- Returns:
- the generated
Diagram, ornullif there was an error during the diagram generation process, implying that no valid diagram could be created.
-
error
java.lang.String error()
Retrieves the error message associated with the diagram processing operation.- Returns:
- the error message if an error occurred, or
nullif the operation completed successfully and a valid diagram was produced.
-
getErrorLine
java.util.Optional<java.lang.Integer> getErrorLine()
Retrieves the line number where an error occurred during the diagram processing operation. This can help in debugging the source of the error in the input provided.- Returns:
- an
Optionalcontaining the line number of the error if an error occurred; otherwise, an emptyOptionalif the operation completed successfully without errors.
-
asImage
java.awt.image.BufferedImage asImage() throws java.io.IOExceptionConverts the generated diagram to an image representation. This can be useful for displaying the diagram in graphical user interfaces or for saving it as a file.- Returns:
- a
BufferedImagerepresenting the diagram. - Throws:
java.io.IOException- if there is an error during the image generation process, such as an issue writing to a file or generating the image from the diagram.
-
getRootCause
java.lang.Throwable getRootCause()
Retrieves the root cause of the error occurred during the diagram processing operation. This method can be particularly useful for obtaining detailed information about exceptions that were caught during the processing of the diagram.- Returns:
- a
Throwableobject representing the root cause of the error, ornullif the operation completed successfully without any exceptions.
-
-