Interface InternalArtifactAstDeserializer
- All Superinterfaces:
ArtifactAstDeserializer
- All Known Implementing Classes:
JsonArtifactAstDeserializer
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.
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize(InputStream artifactAstInputStream, Charset charset, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) default ArtifactAstdeserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver) Given an InputStream created by serializing an ArtifactAst with an ArtifactAstSerializer and the associated extension models, this method deserializes it leveraging the ArtifactAstDeserializerProviders available.default ArtifactAstdeserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) Given an InputStream created by serializing an ArtifactAst with an ArtifactAstSerializer and the associated extension models, this method deserializes it leveraging the ArtifactAstDeserializerProviders available.
-
Method Details
-
deserialize
default ArtifactAst deserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver) throws IllegalArgumentException, IOException Given an InputStream created by serializing an ArtifactAst with an ArtifactAstSerializer and the associated extension models, this method deserializes it leveraging the ArtifactAstDeserializerProviders available.- Specified by:
deserializein interfaceArtifactAstDeserializer- Parameters:
artifactAstInputStream- the input stream generated by an ArtifactAstSerializerextensionModelResolver- an instance ofExtensionModelResolver- Returns:
- The artifact
- Throws:
IllegalArgumentException- if no provider matched the serialization of the artifactIOException- if the input stream could not be read
-
deserialize
default ArtifactAst deserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) throws IllegalArgumentException, IOException Given an InputStream created by serializing an ArtifactAst with an ArtifactAstSerializer and the associated extension models, this method deserializes it leveraging the ArtifactAstDeserializerProviders available.- Specified by:
deserializein interfaceArtifactAstDeserializer- Parameters:
artifactAstInputStream- the input stream generated by an ArtifactAstSerializerextensionModelResolver- an instance ofExtensionModelResolverparent- the parentArtifactAstto be set to the resulting deserializedArtifactAst- Returns:
- The artifact
- Throws:
IllegalArgumentException- if no provider matched the serialization of the artifactIOException- if the input stream could not be read
-
deserialize
ArtifactAst deserialize(InputStream artifactAstInputStream, Charset charset, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) throws IllegalArgumentException, IOException - Throws:
IllegalArgumentExceptionIOException
-