-
- Type Parameters:
M- the type of objects implementing classes can deserialize
- All Known Subinterfaces:
DOTInputModelDeserializer<S,I,M>,InputModelDeserializer<I,M>,SerializationProvider<OUT,IN>
- All Known Implementing Classes:
AbstractFSM2MealyParser,DOTGraphParser,DOTMutableAutomatonParser,FSM2DFAParser,FSM2MealyParserAlternating,FSM2MealyParserIO,LearnLibV2Serialization
public interface ModelDeserializer<M>A generic interface for formalizing an arbitrary deserializer for a given model type.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default MreadModel(byte[] buf)Reads the contents from the given byte buffer and de-serializes it into a model instance.default MreadModel(File f)Reads the contents from the given file and de-serializes it into a model instance.MreadModel(InputStream is)Reads the contents from the given input stream and de-serializes it into a model instance.default MreadModel(URL url)Reads the contents from the given URL and de-serializes it into a model instance.
-
-
-
Method Detail
-
readModel
M readModel(InputStream is) throws IOException, FormatException
Reads the contents from the given input stream and de-serializes it into a model instance. If the format is a textual one, the input stream is typically interpreted inUTF-8.Note: the input stream will not be closed.
- Parameters:
is- the input stream to read data from- Returns:
- the de-serialized model
- Throws:
IOException- if an error occurred while reading from the streamFormatException- if the content of the stream was not in the expected format
-
readModel
default M readModel(URL url) throws IOException, FormatException
Reads the contents from the given URL and de-serializes it into a model instance. If the format is a textual one, the input stream is typically interpreted inUTF-8.- Parameters:
url- the url to read data from- Returns:
- the de-serialized model
- Throws:
IOException- if an error occurred while reading from the streamFormatException- if the content of the stream was not in the expected format
-
readModel
default M readModel(File f) throws IOException, FormatException
Reads the contents from the given file and de-serializes it into a model instance. If the format is a textual one, the input stream is typically interpreted inUTF-8.- Parameters:
f- the file to read data from- Returns:
- the de-serialized model
- Throws:
IOException- if an error occurred while reading from the streamFormatException- if the content of the stream was not in the expected format
-
readModel
default M readModel(byte[] buf) throws IOException, FormatException
Reads the contents from the given byte buffer and de-serializes it into a model instance. If the format is a textual one, the input stream is typically interpreted inUTF-8.- Parameters:
buf- the buffer to read data from- Returns:
- the de-serialized model
- Throws:
IOException- if an error occurred while reading from the streamFormatException- if the content of the stream was not in the expected format
-
-