Interface ArtifactAstDeserializer
- All Known Subinterfaces:
InternalArtifactAstDeserializer
- All Known Implementing Classes:
DefaultArtifactAstDeserializer,JsonArtifactAstDeserializer
InputStream created using an ArtifactAstSerializer into an
ArtifactAst.
The content of the InputStream might have been generated in different ways, depending on the
ArtifactAstSerializer used, each requiring a specific deserialization process to be determined by the implementation.
If the deserializer cannot handle this input stream, an IllegalArgumentException will be thrown.
ExtensionModel related information must be provided by the client code. This means that in order to deserialize, such
information is required and must be presented as an input of the deserialization method.
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver) Given anInputStreamcreated by serializing anArtifactAstwith anArtifactAstSerializerand anExtensionModelResolverable to provide the requiredExtensionModels, this method deserializes theInputStreaminto anArtifactAst.deserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) Given anInputStreamcreated by serializing anArtifactAstwith anArtifactAstSerializerand anExtensionModelResolverable to provide the requiredExtensionModels, this method deserializes theInputStreaminto anArtifactAst.
-
Method Details
-
deserialize
ArtifactAst deserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver) throws IllegalArgumentException, IOException Given anInputStreamcreated by serializing anArtifactAstwith anArtifactAstSerializerand anExtensionModelResolverable to provide the requiredExtensionModels, this method deserializes theInputStreaminto anArtifactAst.- Parameters:
artifactAstInputStream- the input stream generated by anArtifactAstSerializerextensionModelResolver- anExtensionModelResolverable to provide theExtensionModels required by this serializedArtifactAst- Returns:
- The artifact
- Throws:
IllegalArgumentException- if this deserializer cannot perform a deserialization with the givenInputStreamand/orExtensionModelResolverIOException- if the input stream could not be read
-
deserialize
ArtifactAst deserialize(InputStream artifactAstInputStream, ExtensionModelResolver extensionModelResolver, ArtifactAst parent) throws IllegalArgumentException, IOException Given anInputStreamcreated by serializing anArtifactAstwith anArtifactAstSerializerand anExtensionModelResolverable to provide the requiredExtensionModels, this method deserializes theInputStreaminto anArtifactAst.This method accepts a parent
ArtifactAstas an argument. AnArtifactAstmight have a parent that requires its ownExtensionModels in order to be enrich, and furthermore, might be the parent of multipleArtifactAsts. That is why the parent needs to be resolved before its children passing it as a parameter with this method.- Parameters:
artifactAstInputStream- the input stream generated by anArtifactAstSerializerextensionModelResolver- anExtensionModelResolverable to provide theExtensionModels required by this serializedArtifactAstparent- the parentArtifactAstto be set to the resulting deserializedArtifactAst- Returns:
- The artifact
- Throws:
IllegalArgumentException- if this deserializer cannot perform a deserialization with the givenInputStreamand/orExtensionModelResolverIOException- if the input stream could not be read
-