Class SerializableExtension

  • All Implemented Interfaces:
    GeneratorExtension
    Direct Known Subclasses:
    IndirectingSerializableExtension

    public class SerializableExtension
    extends java.lang.Object
    implements GeneratorExtension
    Note: this class pays no attention to whether users have marked any property variables as transient. In fact, it will work most efficiently if users mark ALL variables as transient... to define transient properties for this class, use the constructor which allows a user-specified set of transients.
    • Constructor Detail

      • SerializableExtension

        public SerializableExtension​(java.util.Set transientProperties,
                                     java.util.Map transientPropertyInitializers)
        Parameters:
        transientProperties - a set of Strings, the names of all properties that should be considered transient and not serialized
        transientPropertyInitializers - an optional Map of a subset of the transient property names to non-default initialization expressions, which should be unterminated expressions, and which will be used verbatim in the generated code.
      • SerializableExtension

        public SerializableExtension()
    • Method Detail

      • writeStoreObject

        protected void writeStoreObject​(Property prop,
                                        java.lang.Class propType,
                                        IndentedWriter iw)
                                 throws java.io.IOException
        Throws:
        java.io.IOException
      • writeUnstoreObject

        protected void writeUnstoreObject​(Property prop,
                                          java.lang.Class propType,
                                          IndentedWriter iw)
                                   throws java.io.IOException
        Throws:
        java.io.IOException
      • generateExtraSerWriteStatements

        protected void generateExtraSerWriteStatements​(ClassInfo info,
                                                       java.lang.Class superclassType,
                                                       Property[] props,
                                                       java.lang.Class[] propTypes,
                                                       IndentedWriter iw)
                                                throws java.io.IOException
        Throws:
        java.io.IOException
      • generateExtraSerInitializers

        protected void generateExtraSerInitializers​(ClassInfo info,
                                                    java.lang.Class superclassType,
                                                    Property[] props,
                                                    java.lang.Class[] propTypes,
                                                    IndentedWriter iw)
                                             throws java.io.IOException
        Throws:
        java.io.IOException