Package net.automatalib.serialization
Interface ModelDeserializer<M>
-
- Type Parameters:
M
- the type of objects implementing classes can deserialize
- All Known Subinterfaces:
DOTInputModelDeserializer<S,I,M>
,InputModelDeserializer<I,M>
,InputModelSerializationProvider<I,OUT,IN>
,SerializationProvider<OUT,IN>
,SimpleAutomatonDeserializer<S,I>
,SimpleAutomatonSerializationProvider<S,I>
- All Known Implementing Classes:
AbstractFSM2MealyParser
,AUTSerializationProvider
,DOTGraphParser
,DOTMutableAutomatonParser
,FSM2DFAParser
,FSM2MealyParserAlternating
,FSM2MealyParserIO
,LearnLibV2Serialization
,SAFSerializationDFA
,SAFSerializationNFA
,TAFSerializationDFA
,TAFSerializationMealy
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 M
readModel(byte[] buf)
Reads the contents from the given byte buffer and de-serializes it into a model instance.default M
readModel(File f)
Reads the contents from the given file and de-serializes it into a model instance.M
readModel(InputStream is)
Reads the contents from the given input stream and de-serializes it into a model instance.default M
readModel(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
Reads the contents from the given input stream and de-serializes it into a model instance.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
Reads the contents from the given URL and de-serializes it into a model instance.- 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
Reads the contents from the given file and de-serializes it into a model instance.- 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
Reads the contents from the given byte buffer and de-serializes it into a model instance.- 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
-
-