Package com.mchange.v2.codegen.bean
Class SerializableExtension
java.lang.Object
com.mchange.v2.codegen.bean.SerializableExtension
- All Implemented Interfaces:
GeneratorExtension
- Direct Known Subclasses:
IndirectingSerializableExtension
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 Summary
ConstructorDescriptionSerializableExtension
(Set transientProperties, Map transientPropertyInitializers) -
Method Summary
Modifier and TypeMethodDescriptionvoid
generate
(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) protected void
generateExtraSerInitializers
(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) protected void
generateExtraSerWriteStatements
(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) protected void
writeStoreObject
(Property prop, Class propType, IndentedWriter iw) protected void
writeUnstoreObject
(Property prop, Class propType, IndentedWriter iw)
-
Constructor Details
-
SerializableExtension
- Parameters:
transientProperties
- a set of Strings, the names of all properties that should be considered transient and not serializedtransientPropertyInitializers
- 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 Details
-
extraGeneralImports
- Specified by:
extraGeneralImports
in interfaceGeneratorExtension
-
extraSpecificImports
- Specified by:
extraSpecificImports
in interfaceGeneratorExtension
-
extraInterfaceNames
- Specified by:
extraInterfaceNames
in interfaceGeneratorExtension
-
generate
public void generate(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) throws IOException - Specified by:
generate
in interfaceGeneratorExtension
- Throws:
IOException
-
writeStoreObject
protected void writeStoreObject(Property prop, Class propType, IndentedWriter iw) throws IOException - Throws:
IOException
-
writeUnstoreObject
protected void writeUnstoreObject(Property prop, Class propType, IndentedWriter iw) throws IOException - Throws:
IOException
-
generateExtraSerWriteStatements
protected void generateExtraSerWriteStatements(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) throws IOException - Throws:
IOException
-
generateExtraSerInitializers
protected void generateExtraSerInitializers(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) throws IOException - Throws:
IOException
-