Package com.mchange.v2.codegen.bean
Class SimplePropertyBeanGenerator
- java.lang.Object
-
- com.mchange.v2.codegen.bean.SimplePropertyBeanGenerator
-
- All Implemented Interfaces:
PropertyBeanGenerator
- Direct Known Subclasses:
InnerBeanPropertyBeanGenerator
public class SimplePropertyBeanGenerator extends java.lang.Object implements PropertyBeanGenerator
-
-
Field Summary
Fields Modifier and Type Field Description protected java.util.Set
generalImports
protected java.util.List
generatorExtensions
protected ClassInfo
info
protected java.util.Set
interfaceNames
protected java.util.List
interfaceTypes
protected IndentedWriter
iw
protected java.lang.Class[]
propertyTypes
protected Property[]
props
protected java.util.Set
specificImports
protected java.lang.Class
superclassType
-
Constructor Summary
Constructors Constructor Description SimplePropertyBeanGenerator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addExtension(GeneratorExtension ext)
protected void
addInternalImports()
protected void
addInternalInterfaces()
void
generate(ClassInfo info, Property[] props, java.io.Writer w)
protected void
generateClassJavaDocComment()
protected java.lang.String
getConstructorDefensiveCopyExpression(Property prop, java.lang.Class propType)
java.lang.String
getGeneratorName()
protected java.lang.String
getGetterDefensiveCopyExpression(Property prop, java.lang.Class propType)
int
getJavaVersion()
protected java.lang.String
getSetterDefensiveCopyExpression(Property prop, java.lang.Class propType)
boolean
isForceUnmodifiable()
boolean
isInner()
static void
main(java.lang.String[] argv)
void
removeExtension(GeneratorExtension ext)
protected void
resolveTypes()
void
setForceUnmodifiable(boolean force_unmodifiable)
void
setGeneratorName(java.lang.String generatorName)
void
setInner(boolean inner)
void
setJavaVersion(int java_version)
protected void
writeBannerComments()
protected void
writeBoundPropertyEventSourceMethods()
protected void
writeClassDeclaration()
protected void
writeConstrainedPropertyEventSourceMethods()
protected void
writeCoreBody()
protected void
writeGetterSetterPair(Property prop, java.lang.Class propType)
protected void
writeGetterSetterPairs()
protected void
writeHeader()
protected void
writeImports()
protected void
writeInternalUtilityFunctions()
protected void
writeJavaBeansChangeSupport()
protected void
writeOtherClasses()
protected void
writeOtherFunctions()
protected void
writeOtherVariables()
protected void
writePropertyGetter(Property prop, java.lang.Class propType)
protected void
writePropertyMember(Property prop)
Deprecated.protected void
writePropertyMembers()
Deprecated.protected void
writePropertySetter(Property prop, java.lang.Class propType)
protected void
writePropertyVariable(Property prop)
protected void
writePropertyVariables()
-
-
-
Field Detail
-
info
protected ClassInfo info
-
props
protected Property[] props
-
iw
protected IndentedWriter iw
-
generalImports
protected java.util.Set generalImports
-
specificImports
protected java.util.Set specificImports
-
interfaceNames
protected java.util.Set interfaceNames
-
superclassType
protected java.lang.Class superclassType
-
interfaceTypes
protected java.util.List interfaceTypes
-
propertyTypes
protected java.lang.Class[] propertyTypes
-
generatorExtensions
protected java.util.List generatorExtensions
-
-
Method Detail
-
setInner
public void setInner(boolean inner)
-
isInner
public boolean isInner()
-
setJavaVersion
public void setJavaVersion(int java_version)
- Parameters:
java_version
- a three digit number -- for example Java 1.3.1 is 131
-
getJavaVersion
public int getJavaVersion()
-
setGeneratorName
public void setGeneratorName(java.lang.String generatorName)
-
getGeneratorName
public java.lang.String getGeneratorName()
-
setForceUnmodifiable
public void setForceUnmodifiable(boolean force_unmodifiable)
-
isForceUnmodifiable
public boolean isForceUnmodifiable()
-
addExtension
public void addExtension(GeneratorExtension ext)
-
removeExtension
public void removeExtension(GeneratorExtension ext)
-
generate
public void generate(ClassInfo info, Property[] props, java.io.Writer w) throws java.io.IOException
- Specified by:
generate
in interfacePropertyBeanGenerator
- Throws:
java.io.IOException
-
resolveTypes
protected void resolveTypes()
-
addInternalImports
protected void addInternalImports()
-
addInternalInterfaces
protected void addInternalInterfaces()
-
writeCoreBody
protected void writeCoreBody() throws java.io.IOException
- Throws:
java.io.IOException
-
writeInternalUtilityFunctions
protected void writeInternalUtilityFunctions() throws java.io.IOException
- Throws:
java.io.IOException
-
writeConstrainedPropertyEventSourceMethods
protected void writeConstrainedPropertyEventSourceMethods() throws java.io.IOException
- Throws:
java.io.IOException
-
writeBoundPropertyEventSourceMethods
protected void writeBoundPropertyEventSourceMethods() throws java.io.IOException
- Throws:
java.io.IOException
-
writeJavaBeansChangeSupport
protected void writeJavaBeansChangeSupport() throws java.io.IOException
- Throws:
java.io.IOException
-
writeOtherVariables
protected void writeOtherVariables() throws java.io.IOException
- Throws:
java.io.IOException
-
writeOtherFunctions
protected void writeOtherFunctions() throws java.io.IOException
- Throws:
java.io.IOException
-
writeOtherClasses
protected void writeOtherClasses() throws java.io.IOException
- Throws:
java.io.IOException
-
writePropertyVariables
protected void writePropertyVariables() throws java.io.IOException
- Throws:
java.io.IOException
-
writePropertyVariable
protected void writePropertyVariable(Property prop) throws java.io.IOException
- Throws:
java.io.IOException
-
writePropertyMembers
protected void writePropertyMembers() throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
writePropertyMember
protected void writePropertyMember(Property prop) throws java.io.IOException
Deprecated.- Throws:
java.io.IOException
-
writeGetterSetterPairs
protected void writeGetterSetterPairs() throws java.io.IOException
- Throws:
java.io.IOException
-
writeGetterSetterPair
protected void writeGetterSetterPair(Property prop, java.lang.Class propType) throws java.io.IOException
- Throws:
java.io.IOException
-
writePropertyGetter
protected void writePropertyGetter(Property prop, java.lang.Class propType) throws java.io.IOException
- Throws:
java.io.IOException
-
writePropertySetter
protected void writePropertySetter(Property prop, java.lang.Class propType) throws java.io.IOException
- Throws:
java.io.IOException
-
getGetterDefensiveCopyExpression
protected java.lang.String getGetterDefensiveCopyExpression(Property prop, java.lang.Class propType)
-
getSetterDefensiveCopyExpression
protected java.lang.String getSetterDefensiveCopyExpression(Property prop, java.lang.Class propType)
-
getConstructorDefensiveCopyExpression
protected java.lang.String getConstructorDefensiveCopyExpression(Property prop, java.lang.Class propType)
-
writeHeader
protected void writeHeader() throws java.io.IOException
- Throws:
java.io.IOException
-
writeBannerComments
protected void writeBannerComments() throws java.io.IOException
- Throws:
java.io.IOException
-
generateClassJavaDocComment
protected void generateClassJavaDocComment() throws java.io.IOException
- Throws:
java.io.IOException
-
writeImports
protected void writeImports() throws java.io.IOException
- Throws:
java.io.IOException
-
writeClassDeclaration
protected void writeClassDeclaration() throws java.io.IOException
- Throws:
java.io.IOException
-
main
public static void main(java.lang.String[] argv)
-
-