Class ThreatXlsxOutputStream
java.lang.Object
java.io.OutputStream
be.kuleuven.cs.distrinet.sparta.io.ThreatOutputStream
be.kuleuven.cs.distrinet.sparta.io.ThreatXlsxOutputStream
- All Implemented Interfaces:
Closeable,Flushable,AutoCloseable
Outputstream to support directly writing threats to an xlsx file (e.g.,
FileOutputStream). This class takes care of all the conversion
necessary to write out an xlsx file. Users are discouraged to directly write
anything other than write(Threat) or ThreatOutputStream.write(Threat...) as
the other operations could interfere with the file format.-
Field Summary
Fields inherited from class be.kuleuven.cs.distrinet.sparta.io.ThreatOutputStream
outputStream -
Constructor Summary
ConstructorsConstructorDescriptionCreate a newThreatXlsxOutputStreamthat writes to out.ThreatXlsxOutputStream(OutputStream out, Map<String, Function<Threat, ? extends Object>> properties) Create a newThreatXlsxOutputStreamthat writes to out. -
Method Summary
Methods inherited from class be.kuleuven.cs.distrinet.sparta.io.ThreatOutputStream
flush, getProperties, writeMethods inherited from class java.io.OutputStream
nullOutputStream, write, write
-
Constructor Details
-
ThreatXlsxOutputStream
Create a newThreatXlsxOutputStreamthat writes to out.- Parameters:
out- theOutputStreamto use.
-
ThreatXlsxOutputStream
public ThreatXlsxOutputStream(OutputStream out, Map<String, Function<Threat, ? extends Object>> properties) Create a newThreatXlsxOutputStreamthat writes to out. If any of the provided functions return a, theinvalid reference
DFDModelElementThreatWriterwill attempt to retrieve the name of the element when writing it to the output writer.- Parameters:
out- theOutputStreamto use.properties- 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 classThreatOutputStream- Parameters:
threat- theThreatto write out- Throws:
IOException- If an I/O error occurs.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classThreatOutputStream- Throws:
IOException
-
write
- Specified by:
writein classOutputStream- Throws:
IOException
-