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
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 Summary
Constructors Constructor Description SerializableExtension()
SerializableExtension(java.util.Set transientProperties, java.util.Map transientPropertyInitializers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection
extraGeneralImports()
java.util.Collection
extraInterfaceNames()
java.util.Collection
extraSpecificImports()
void
generate(ClassInfo info, java.lang.Class superclassType, Property[] props, java.lang.Class[] propTypes, IndentedWriter iw)
protected void
generateExtraSerInitializers(ClassInfo info, java.lang.Class superclassType, Property[] props, java.lang.Class[] propTypes, IndentedWriter iw)
protected void
generateExtraSerWriteStatements(ClassInfo info, java.lang.Class superclassType, Property[] props, java.lang.Class[] propTypes, IndentedWriter iw)
protected void
writeStoreObject(Property prop, java.lang.Class propType, IndentedWriter iw)
protected void
writeUnstoreObject(Property prop, java.lang.Class propType, IndentedWriter iw)
-
-
-
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 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 Detail
-
extraGeneralImports
public java.util.Collection extraGeneralImports()
- Specified by:
extraGeneralImports
in interfaceGeneratorExtension
-
extraSpecificImports
public java.util.Collection extraSpecificImports()
- Specified by:
extraSpecificImports
in interfaceGeneratorExtension
-
extraInterfaceNames
public java.util.Collection extraInterfaceNames()
- Specified by:
extraInterfaceNames
in interfaceGeneratorExtension
-
generate
public void generate(ClassInfo info, java.lang.Class superclassType, Property[] props, java.lang.Class[] propTypes, IndentedWriter iw) throws java.io.IOException
- Specified by:
generate
in interfaceGeneratorExtension
- Throws:
java.io.IOException
-
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
-
-