Class AbstractThreatTableExportHandler

java.lang.Object
org.eclipse.core.commands.common.EventManager
org.eclipse.core.commands.AbstractHandler
be.kuleuven.cs.distrinet.sparta.analysis.handlers.AbstractAnalysisExportHandler
be.kuleuven.cs.distrinet.sparta.analysis.handlers.AbstractThreatTableExportHandler
All Implemented Interfaces:
org.eclipse.core.commands.IHandler, org.eclipse.core.commands.IHandler2
Direct Known Subclasses:
CSVExportHandler, XLSXExportHandler

public abstract class AbstractThreatTableExportHandler extends AbstractAnalysisExportHandler
Exports the current analysis results to a table file in the root of the analysed model's project. Subclasses only provide the file name and the writer, so the CSV and XLSX exports share the same columns (ThreatExportColumns.withMetadata()) and user feedback.
  • Constructor Details

    • AbstractThreatTableExportHandler

      public AbstractThreatTableExportHandler()
  • Method Details

    • fileName

      protected abstract String fileName()
      Returns:
      the name of the file to create in the project root, e.g. threats.csv
    • formatName

      protected abstract String formatName()
      Returns:
      a short format label used in messages, e.g. CSV
    • export

      protected abstract void export(File file, Threat[] threats) throws IOException
      Write the threats to file, using ThreatExportColumns.withMetadata().
      Throws:
      IOException
    • execute

      public Object execute(org.eclipse.core.commands.ExecutionEvent event) throws org.eclipse.core.commands.ExecutionException
      Throws:
      org.eclipse.core.commands.ExecutionException