Interface IDataSerializer
- All Known Implementing Classes:
JsonSerializer
,XmlSerializer
public interface IDataSerializer
Serializer interface for DataValue serialization.
- Since:
- 9.3
- Author:
- A.Pragt
-
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(DataValueType type, Reader reader) Deserializes data (as provided by a reader) to an object of a particular type.deserializeWithoutChecking
(DataValueType type, Reader reader) Deserializes data (as provided by a reader) to an object of a particular type.Returns the mime type of the serialized data.void
Serializes an object to a writer
-
Method Details
-
getMimeType
String getMimeType()Returns the mime type of the serialized data.- Returns:
- The mimetype, never null.
-
serialize
Serializes an object to a writer- Parameters:
data
- The data to serialize, not null.target
- The target stream to write to, not null.- Throws:
DataSerializationException
- when serializing fails
-
deserialize
Deserializes data (as provided by a reader) to an object of a particular type.- Parameters:
type
- The type description of the data to be deserialized, not null.reader
- The source Reader to read from, not null.- Returns:
- The deserialized object, never null.
- Throws:
DataSerializationException
- when deserializing fails
-
deserializeWithoutChecking
Deserializes data (as provided by a reader) to an object of a particular type. If the value provided does not conform to the schema this method will continue and leaves the error detection to the parser.- Parameters:
type
- The type description of the data to be deserialized, not null.reader
- The source Reader to read from, not null.- Returns:
- The deserialized object, never null.
- Throws:
DataSerializationException
- when deserializing fails
-