Class XmlSerializer
java.lang.Object
com.aquima.interactions.communication.data.serialization.xml.XmlSerializer
- All Implemented Interfaces:
IDataSerializer
Serializer for reading/writing DataObject to Xml format.
- Since:
- 9.3
- Author:
- A.Pragt
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a serializer with no indention.XmlSerializer
(boolean indent) Constructs a serializer. -
Method Summary
Modifier and TypeMethodDescriptiondeserialize
(DataValueType type, Reader source) 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
-
Field Details
-
MIMETYPE
- See Also:
-
-
Constructor Details
-
XmlSerializer
public XmlSerializer()Constructs a serializer with no indention. -
XmlSerializer
public XmlSerializer(boolean indent) Constructs a serializer.- Parameters:
indent
- Indicator to whether to use indention or not.
-
-
Method Details
-
getMimeType
Description copied from interface:IDataSerializer
Returns the mime type of the serialized data.- Specified by:
getMimeType
in interfaceIDataSerializer
- Returns:
- The mimetype, never null.
-
serialize
Description copied from interface:IDataSerializer
Serializes an object to a writer- Specified by:
serialize
in interfaceIDataSerializer
- Parameters:
data
- The data to serialize, not null.target
- The target stream to write to, not null.- Throws:
DataSerializationException
- when serializing fails
-
deserialize
Description copied from interface:IDataSerializer
Deserializes data (as provided by a reader) to an object of a particular type.- Specified by:
deserialize
in interfaceIDataSerializer
- Parameters:
type
- The type description of the data to be deserialized, not null.source
- The source Reader to read from, not null.- Returns:
- The deserialized object, never null.
- Throws:
DataSerializationException
- when deserializing fails
-
deserializeWithoutChecking
public DataValue deserializeWithoutChecking(DataValueType type, Reader reader) throws DataSerializationException Description copied from interface:IDataSerializer
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.- Specified by:
deserializeWithoutChecking
in interfaceIDataSerializer
- 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
-