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
ConstructorsConstructorDescriptionSerializableExtension(Set transientProperties, Map transientPropertyInitializers) -
Method Summary
Modifier and TypeMethodDescriptionvoidgenerate(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) protected voidgenerateExtraSerInitializers(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) protected voidgenerateExtraSerWriteStatements(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) protected voidwriteStoreObject(Property prop, Class propType, IndentedWriter iw) protected voidwriteUnstoreObject(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:
extraGeneralImportsin interfaceGeneratorExtension
-
extraSpecificImports
- Specified by:
extraSpecificImportsin interfaceGeneratorExtension
-
extraInterfaceNames
- Specified by:
extraInterfaceNamesin interfaceGeneratorExtension
-
generate
public void generate(ClassInfo info, Class superclassType, Property[] props, Class[] propTypes, IndentedWriter iw) throws IOException - Specified by:
generatein 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
-