com.pnfsoftware.jeb.util.serialization.annotations.SerCustomInit |
This annotation is used to initialize an object after its fields have been deserialized.
SerCustomRead
could be used instead, but this method is better suited and simpler to use
if standard field deserialization took place, and all that's needed is a post-deserialization
initializer. Note that SerCustomRead and SerCustomInit are not mutually exclusive; an object may
decide to use both. SerCustomInit is called after SerCustomRead.
private void init()
Note that the visibility MUST be private to make sure that sub-classes do not accidentally override a custom initializer method of a super-class.
Important state information: When this method is called, the object may not have been
fully restored: in particular, collections and maps will have been created, but will not have
been populated yet (re: deferred population to avoid inconsistencies resulting from manipulating
incomplete (not fully deserialized) values or keys). Therefore, only null/non-null checks must be
performed on @Ser maps and collections (arrays, sets, etc.). Attempting to iterate over those in
this methods is useless. If you need to access collections and maps elements of a deserialized
object to perform initialization, that must be done in a SerCustomInitPostGraph
method.
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |