Class ExceptionReportCreator
java.lang.Object
com.vaadin.copilot.exception.report.ExceptionReportCreator
A builder-style class used to construct an
ExceptionReport instance.
This class collects various pieces of information relevant to an exception
report, including a title, component details, relevant data pairs, and
component node context. It serves as a flexible intermediary to assemble all
necessary parts before creating a finalized ExceptionReport.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddComponentInfo(ComponentInfo componentInfo) Adds singleComponentInfoto the list of component information that are used to extract source codevoidaddComponentInfo(List<ComponentInfo> componentInfos) Adds multipleComponentInfoobjects to the list of component information that are used to extract source codevoidaddRelevantComponentNode(ExceptionReportRelevantComponentNode exceptionReportRelevantComponentNode) Method that adds relevant nodes into a listvoidaddRelevantComponentNode(String relevance, tools.jackson.databind.JsonNode component) A utility method to add relevant component node for the report.voidMethod that adds given pair into a list.create()Creates exception report from the information that is provided.getTitle()voidSets title of the report.
-
Constructor Details
-
ExceptionReportCreator
public ExceptionReportCreator()
-
-
Method Details
-
addRelevantPair
Method that adds given pair into a list.- Parameters:
pair- Pair that is relevant to the action.
-
addRelevantComponentNode
public void addRelevantComponentNode(ExceptionReportRelevantComponentNode exceptionReportRelevantComponentNode) Method that adds relevant nodes into a list- Parameters:
exceptionReportRelevantComponentNode- Node to be added
-
addRelevantComponentNode
A utility method to add relevant component node for the report. Component node id and ui Id are obtained from component JSON withuiIdandnodeIdkeys- Parameters:
relevance- a string that represents the component with the action.component- JSON object that should containnodeIdanduiId
-
create
Creates exception report from the information that is provided. Eliminates irrelevant info from the source that is provided byComponentInfoand generates a simplified class source code for the report.- Returns:
- Exception report
-
addComponentInfo
Adds singleComponentInfoto the list of component information that are used to extract source code- Parameters:
componentInfo- the component information to be added
-
addComponentInfo
Adds multipleComponentInfoobjects to the list of component information that are used to extract source code- Parameters:
componentInfos- a list of component information objects to be added
-
getTitle
-
setTitle
Sets title of the report. This will be used in GH as issue title.- Parameters:
title- title that represents what exception is about
-