com.mchange.v2.codegen.bean
Class SimplePropertyBeanGenerator

java.lang.Object
  extended by com.mchange.v2.codegen.bean.SimplePropertyBeanGenerator
All Implemented Interfaces:
PropertyBeanGenerator
Direct Known Subclasses:
InnerBeanPropertyBeanGenerator

public class SimplePropertyBeanGenerator
extends Object
implements PropertyBeanGenerator


Field Summary
protected  Set generalImports
           
protected  List generatorExtensions
           
protected  ClassInfo info
           
protected  Set interfaceNames
           
protected  List interfaceTypes
           
protected  IndentedWriter iw
           
protected  Class[] propertyTypes
           
protected  Property[] props
           
protected  Set specificImports
           
protected  Class superclassType
           
 
Constructor Summary
SimplePropertyBeanGenerator()
           
 
Method Summary
 void addExtension(GeneratorExtension ext)
           
protected  void addInternalImports()
           
protected  void addInternalInterfaces()
           
 void generate(ClassInfo info, Property[] props, Writer w)
           
protected  String getConstructorDefensiveCopyExpression(Property prop, Class propType)
           
 String getGeneratorName()
           
protected  String getGetterDefensiveCopyExpression(Property prop, Class propType)
           
 int getJavaVersion()
           
protected  String getSetterDefensiveCopyExpression(Property prop, Class propType)
           
 boolean isForceUnmodifiable()
           
 boolean isInner()
           
static void main(String[] argv)
           
 void removeExtension(GeneratorExtension ext)
           
protected  void resolveTypes()
           
 void setForceUnmodifiable(boolean force_unmodifiable)
           
 void setGeneratorName(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, 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, Class propType)
           
protected  void writePropertyMember(Property prop)
          Deprecated.  
protected  void writePropertyMembers()
          Deprecated.  
protected  void writePropertySetter(Property prop, Class propType)
           
protected  void writePropertyVariable(Property prop)
           
protected  void writePropertyVariables()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

info

protected ClassInfo info

props

protected Property[] props

iw

protected IndentedWriter iw

generalImports

protected Set generalImports

specificImports

protected Set specificImports

interfaceNames

protected Set interfaceNames

superclassType

protected Class superclassType

interfaceTypes

protected List interfaceTypes

propertyTypes

protected Class[] propertyTypes

generatorExtensions

protected List generatorExtensions
Constructor Detail

SimplePropertyBeanGenerator

public SimplePropertyBeanGenerator()
Method Detail

setInner

public void setInner(boolean inner)

isInner

public boolean isInner()

setJavaVersion

public void setJavaVersion(int java_version)
Parameters:
version - a three digit number -- for example Java 1.3.1 is 131

getJavaVersion

public int getJavaVersion()

setGeneratorName

public void setGeneratorName(String generatorName)

getGeneratorName

public 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,
                     Writer w)
              throws IOException
Specified by:
generate in interface PropertyBeanGenerator
Throws:
IOException

resolveTypes

protected void resolveTypes()

addInternalImports

protected void addInternalImports()

addInternalInterfaces

protected void addInternalInterfaces()

writeCoreBody

protected void writeCoreBody()
                      throws IOException
Throws:
IOException

writeInternalUtilityFunctions

protected void writeInternalUtilityFunctions()
                                      throws IOException
Throws:
IOException

writeConstrainedPropertyEventSourceMethods

protected void writeConstrainedPropertyEventSourceMethods()
                                                   throws IOException
Throws:
IOException

writeBoundPropertyEventSourceMethods

protected void writeBoundPropertyEventSourceMethods()
                                             throws IOException
Throws:
IOException

writeJavaBeansChangeSupport

protected void writeJavaBeansChangeSupport()
                                    throws IOException
Throws:
IOException

writeOtherVariables

protected void writeOtherVariables()
                            throws IOException
Throws:
IOException

writeOtherFunctions

protected void writeOtherFunctions()
                            throws IOException
Throws:
IOException

writeOtherClasses

protected void writeOtherClasses()
                          throws IOException
Throws:
IOException

writePropertyVariables

protected void writePropertyVariables()
                               throws IOException
Throws:
IOException

writePropertyVariable

protected void writePropertyVariable(Property prop)
                              throws IOException
Throws:
IOException

writePropertyMembers

protected void writePropertyMembers()
                             throws IOException
Deprecated. 

Throws:
IOException

writePropertyMember

protected void writePropertyMember(Property prop)
                            throws IOException
Deprecated. 

Throws:
IOException

writeGetterSetterPairs

protected void writeGetterSetterPairs()
                               throws IOException
Throws:
IOException

writeGetterSetterPair

protected void writeGetterSetterPair(Property prop,
                                     Class propType)
                              throws IOException
Throws:
IOException

writePropertyGetter

protected void writePropertyGetter(Property prop,
                                   Class propType)
                            throws IOException
Throws:
IOException

writePropertySetter

protected void writePropertySetter(Property prop,
                                   Class propType)
                            throws IOException
Throws:
IOException

getGetterDefensiveCopyExpression

protected String getGetterDefensiveCopyExpression(Property prop,
                                                  Class propType)

getSetterDefensiveCopyExpression

protected String getSetterDefensiveCopyExpression(Property prop,
                                                  Class propType)

getConstructorDefensiveCopyExpression

protected String getConstructorDefensiveCopyExpression(Property prop,
                                                       Class propType)

writeHeader

protected void writeHeader()
                    throws IOException
Throws:
IOException

writeBannerComments

protected void writeBannerComments()
                            throws IOException
Throws:
IOException

writeImports

protected void writeImports()
                     throws IOException
Throws:
IOException

writeClassDeclaration

protected void writeClassDeclaration()
                              throws IOException
Throws:
IOException

main

public static void main(String[] argv)