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
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().-
Field Summary
Fields inherited from class be.kuleuven.cs.distrinet.sparta.io.ThreatWriter
writer -
Constructor Summary
ConstructorsConstructorDescriptionThreatCSVWriter(Writer writer) Create a newThreatCSVWriterto provided support for writing out a default set of threat properties to text-based files.Create a newThreatCSVWriterto provided support for writing out a specified set of threat properties to text-based files. -
Method Summary
Modifier and TypeMethodDescriptionvoidWrite-out a threatvoidWrite a csv header based on the provided set of property names inThreatCSVWriter(Writer, Map)Methods inherited from class be.kuleuven.cs.distrinet.sparta.io.ThreatWriter
close, flush, getProperties, newLine, write, write
-
Constructor Details
-
ThreatCSVWriter
Create a newThreatCSVWriterto provided support for writing out a default set of threat properties to text-based files.- Parameters:
writer- a writer
-
ThreatCSVWriter
Create a newThreatCSVWriterto provided support for writing out a specified set of threat properties to text-based files. If any of the provided functions return aModelElement, theThreatWriterwill attempt to retrieve the name of the element when writing it to the output writer.- Parameters:
writer- a writerproperties- a set of functions, which applied to a threat provide the property to write out
-
-
Method Details
-
write
Write-out a threat- Specified by:
writein classThreatWriter- Parameters:
threat- theThreatto write out- Throws:
IOException- If an I/O error occurs.
-
writeHeader
Write a csv header based on the provided set of property names inThreatCSVWriter(Writer, Map)- Throws:
IOException- If an I/O error occurs
-