Class SSSOMSerializer
java.lang.Object
de.uni_mannheim.informatik.dws.melt.yet_another_alignment_api.SSSOMSerializer
The SSSOMSerializer can serialize to SSSOM files following the convention described in the
SSSOM github and userguide.
- Author:
- Sven Hertling
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Serializes an alignment as String.static String
Serializes an alignment as String.static void
Method to write the specified alignment to the specified file in the SSSOM format.static void
serialize
(Alignment alignment, OutputStream stream) Method to write the specified alignment to the specified file in the SSSOM format.static void
serialize
(Alignment alignment, OutputStream stream, boolean includeNonSSSOMAttributes) Method to write the specified alignment to the specified file in the SSSOM format.private static void
writeMetadata
(SSSOMPrefixMap prefixMap, Alignment a, OutputStreamWriter writer, boolean includeNonSSSOMAttributes)
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
ENCODING
Constant for UTF-8 encoding. -
SSSOM_ALTERNATIVES
-
NEWLINE
-
-
Constructor Details
-
SSSOMSerializer
public SSSOMSerializer()
-
-
Method Details
-
serialize
Method to write the specified alignment to the specified file in the SSSOM format.- Parameters:
alignment
- The alignment that shall be written.file
- The file to which the alignment shall be written.- Throws:
IOException
- Exception that occurred while serializing the alignment.
-
serialize
Serializes an alignment as String.- Parameters:
alignment
- The alignment to be serialized.- Returns:
- Alignment as String.
- Throws:
IOException
- in case of an io error
-
serialize
public static String serialize(Alignment alignment, boolean includeNonSSSOMAttributes) throws IOException Serializes an alignment as String.- Parameters:
alignment
- The alignment to be serialized.includeNonSSSOMAttributes
- if true include also non SSSOM attributes in the output.- Returns:
- Alignment as String.
- Throws:
IOException
- in case of an io error
-
initAlternatives
-
serialize
Method to write the specified alignment to the specified file in the SSSOM format. The providedOutputStream
is not closed.- Parameters:
alignment
- The alignment that shall be written.stream
- the stream where the serialized alignment should be written to (the stream is not closed)- Throws:
IOException
- Exception that occurred while serializing the alignment.
-
serialize
public static void serialize(Alignment alignment, OutputStream stream, boolean includeNonSSSOMAttributes) throws IOException Method to write the specified alignment to the specified file in the SSSOM format. The providedOutputStream
is not closed.- Parameters:
alignment
- The alignment that shall be written.stream
- the stream where the serialized alignment should be written to (the stream is not closed)includeNonSSSOMAttributes
- if true include also non SSSOM attributes in the output.- Throws:
IOException
- Exception that occurred while serializing the alignment.
-
writeMetadata
private static void writeMetadata(SSSOMPrefixMap prefixMap, Alignment a, OutputStreamWriter writer, boolean includeNonSSSOMAttributes) throws IOException - Throws:
IOException
-