public interface InternalArtifactAstDeserializer extends ArtifactAstDeserializer
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.
| Modifier and Type | Method and Description |
|---|---|
default ArtifactAst |
deserialize(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 ArtifactAst |
deserialize(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.
|
ArtifactAst |
deserialize(InputStream artifactAstInputStream,
String version,
Charset charset,
ExtensionModelResolver extensionModelResolver,
ArtifactAst parent) |
String |
getLatestVersion() |
default ArtifactAst deserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver) throws IllegalArgumentException, IOException
deserialize in interface ArtifactAstDeserializerartifactAstInputStream - the input stream generated by an ArtifactAstSerializerextensionModelResolver - an instance of ExtensionModelResolverIllegalArgumentException - if no provider matched the serialization of the artifactIOException - if the input stream could not be readdefault ArtifactAst deserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) throws IllegalArgumentException, IOException
deserialize in interface ArtifactAstDeserializerartifactAstInputStream - the input stream generated by an ArtifactAstSerializerextensionModelResolver - an instance of ExtensionModelResolverparent - the parent ArtifactAst to be set to the resulting deserialized ArtifactAstIllegalArgumentException - if no provider matched the serialization of the artifactIOException - if the input stream could not be readString getLatestVersion()
ArtifactAst deserialize(InputStream artifactAstInputStream, String version, Charset charset, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) throws IllegalArgumentException, IOException
IllegalArgumentExceptionIOExceptionCopyright © 2022 MuleSoft, Inc.. All rights reserved.