Package net.sourceforge.plantuml.api.v2
Interface DiagramReturn
public interface DiagramReturn
Provides an interface to retrieve the results of a diagram processing
operation. This interface allows for obtaining either a
Diagram
object if the operation was successful, or an error message if the operation
failed, along with the line number where the error occurred.-
Method Summary
Modifier and TypeMethodDescriptionasImage()
Converts the generated diagram to an image representation.error()
Retrieves the error message associated with the diagram processing operation.Retrieves theDiagram
generated by the diagram processing operation.Retrieves the line number where an error occurred during the diagram processing operation.Retrieves the root cause of the error occurred during the diagram processing operation.
-
Method Details
-
getDiagram
Diagram getDiagram()Retrieves theDiagram
generated by the diagram processing operation.- Returns:
- the generated
Diagram
, ornull
if there was an error during the diagram generation process, implying that no valid diagram could be created.
-
error
String error()Retrieves the error message associated with the diagram processing operation.- Returns:
- the error message if an error occurred, or
null
if the operation completed successfully and a valid diagram was produced.
-
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. -
asImage
Converts 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
BufferedImage
representing the diagram. - Throws:
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
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
Throwable
object representing the root cause of the error, ornull
if the operation completed successfully without any exceptions.
-