Class ThreatCSVWriter

java.lang.Object
java.io.Writer
be.kuleuven.cs.distrinet.sparta.io.ThreatWriter
be.kuleuven.cs.distrinet.sparta.io.ThreatCSVWriter
All Implemented Interfaces:
Closeable, Flushable, Appendable, AutoCloseable

public class ThreatCSVWriter extends ThreatWriter
A ThreatWriter to export one or more threats to a csv file. This writer does not automatically write a CSV header. If this is needed it can be manually written out using Writer.write(String) or writeHeader().
  • Constructor Details

    • ThreatCSVWriter

      public ThreatCSVWriter(Writer writer)
      Create a new ThreatCSVWriter to provided support for writing out a default set of threat properties to text-based files.
      Parameters:
      writer - a writer
    • ThreatCSVWriter

      public ThreatCSVWriter(Writer writer, Map<String,Function<Threat,? extends Object>> properties)
      Create a new ThreatCSVWriter to provided support for writing out a specified set of threat properties to text-based files. If any of the provided functions return a ModelElement, the ThreatWriter will attempt to retrieve the name of the element when writing it to the output writer.
      Parameters:
      writer - a writer
      properties - a set of functions, which applied to a threat provide the property to write out
  • Method Details