Interface InternalArtifactAstDeserializer

All Superinterfaces:
ArtifactAstDeserializer
All Known Implementing Classes:
JsonArtifactAstDeserializer

public interface InternalArtifactAstDeserializer extends ArtifactAstDeserializer
Defines a component capable of serializing ArtifactAsts into/from 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 InputStream and will be composed by an ID corresponding to the serializer used followed by its version and the Charset name used. This values will be delimited by a pound (#) character.

Eg: SERIALIZERID#1.2.3#UTF-8#

Once the first line has been read, the remaining payload of the InputStream (which we will call "the body") will be the serialized artifact itself in the format implemented by the serializer that was used.

It should be noted when implementing a deserialize method that when deserializing, the InputStream should only contain the body without the metadata. This is because for an implementation of the deserialize method to be called, the caller needs to know which one matches the InputStream and that requires for the metadata line to be consumed.