Interface ArtifactAstSerializer
- All Known Implementing Classes:
JsonArtifactAstSerializer
@NoImplement
public interface ArtifactAstSerializer
Defines a component capable of serializing
ArtifactAsts into an InputStream.
A serialized ArtifactAst will contain the information of the original artifact and some more metadata relevant to the
serializer. This metadata will be entirely and exclusively in the first line of the resulting input stream, in UTF-8 encoding,
and will be composed by an ID corresponding to the serializer used followed by its version and the charset used in the body.
This values will be delimited by a pound (#) character like the following example shows: "SERIALIZERID#1.2.3#UTF-8#".
This metadata is required by the ArtifactAstDeserializer in order to determine which deserializer to use with the
provided input stream.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionserialize(ArtifactAst artifactAst) Serializes anArtifactAstinto anInputStreamadding string metadata in the first line followed by the serialized content.
-
Method Details
-
serialize
Serializes anArtifactAstinto anInputStreamadding string metadata in the first line followed by the serialized content.- Parameters:
artifactAst- The AST of the artifact to be serialized- Returns:
- an
InputStreamcontaining a first line with metadata (a String with serializer id and version delimited by the character '#') followed by the serialized content.
-