Object
KineticStreamController
Allows user to control behavior of
KineticStreamReader
and KineticStreamWriter
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiononNextObject
(InputKineticStream in, Object obj, Class<?> fieldType) Decide whether to skip reading next field or not as well as perform custom deserialization.onNextObject
(OutputKineticStream out, Object obj) Decide whether to skip writing next field or not as well as perform custom serialization.withFieldsProvider
(StreamedFieldsProvider fieldsProvider)
-
Constructor Details
-
KineticStreamController
public KineticStreamController()
-
-
Method Details
-
withFieldsProvider
-
getFieldsProvider
-
onNextObject
public KineticStreamController.WriterResult onNextObject(OutputKineticStream out, Object obj) throws Exception Decide whether to skip writing next field or not as well as perform custom serialization.By overriding this method users can write object manually.
- Parameters:
obj
- object from the field which is about to be serialized- Throws:
Exception
-
onNextObject
public KineticStreamController.ReaderResult onNextObject(InputKineticStream in, Object obj, Class<?> fieldType) throws Exception Decide whether to skip reading next field or not as well as perform custom deserialization.By overriding this method users can read object manually and return it back to
KineticStreamReader
which will store it as a field of the deserialized object.Please note that when
KineticStreamReader.read(Class)
is called thenonNextObject(InputKineticStream, Object, Class)
is issued for that Class fields and not for the Class itself. For example read(Data.class) will not result to onNextObject call with Data.class as a fieldType but to Data fields instead (this is needed to avoid possible recursion in case users try to call read(Data.class) from onNextObject).- Parameters:
obj
- object from the field which is about to be deserializedfieldType
- type of the field whichKineticStreamReader
is about to deserialize- Throws:
Exception
-