public class ImplementationGenerator extends Object
Modifier and Type | Field and Description |
---|---|
protected byte[] |
bytes
bytes for the implementation class.
|
protected String |
className
Class name of the implementation.
|
protected String |
fullClassName
Fully-qualified class name (including package) of the implementation.
|
protected String |
fullSuperclassName
Class name for the superclass.
|
protected AbstractClassMetaData |
inputCmd
Meta data for the abstract-class/interface
|
protected MetaDataManager |
metaDataMgr |
Constructor and Description |
---|
ImplementationGenerator(ClassMetaData cmd,
String implClassName,
MetaDataManager mmgr)
Constructor for an implementation of an abstract class.
|
ImplementationGenerator(InterfaceMetaData interfaceMetaData,
String implClassName,
MetaDataManager mmgr)
Constructor for an implementation of a persistent interface.
|
Modifier and Type | Method and Description |
---|---|
protected void |
createDefaultConstructor()
Create a default constructor, assuming that there is no persistent superclass.
|
protected void |
createGetter(AbstractMemberMetaData mmd)
Create a getter method for a /property.
|
protected void |
createPropertyFields()
Creates fields for the properties of this class and super classes.
|
protected void |
createPropertyFields(AbstractClassMetaData acmd)
Create the fields for the implementation.
|
protected void |
createPropertyMethods()
Create getters and setters methods for this class and super classes
|
protected void |
createPropertyMethods(AbstractClassMetaData acmd)
Create getters and setters methods.
|
protected void |
createSetter(AbstractMemberMetaData mmd)
Create a setter method for a property.
|
void |
dumpToFile(String filename)
Convenience method to dump the generated class to the specified file.
|
void |
enhance(ClassLoaderResolver clr)
Enhance the implementation of the class/interface.
|
byte[] |
getBytes()
Accessor for the byte representation of the generated class.
|
protected final MetaDataManager metaDataMgr
protected final AbstractClassMetaData inputCmd
protected final String className
protected final String fullClassName
protected String fullSuperclassName
protected byte[] bytes
public ImplementationGenerator(InterfaceMetaData interfaceMetaData, String implClassName, MetaDataManager mmgr)
interfaceMetaData
- MetaData for the persistent interfaceimplClassName
- Name of the implementation class to generate (omitting packages)mmgr
- MetaData managerpublic ImplementationGenerator(ClassMetaData cmd, String implClassName, MetaDataManager mmgr)
cmd
- MetaData for the abstract classimplClassName
- Name of the implementation class to generate (omitting packages)mmgr
- MetaData managerpublic byte[] getBytes()
protected void createPropertyFields()
protected void createPropertyMethods()
protected void createPropertyMethods(AbstractClassMetaData acmd)
acmd
- AbstractClassMetaDatapublic void dumpToFile(String filename)
filename
- Name of the file to dump topublic void enhance(ClassLoaderResolver clr)
clr
- ClassLoader resolverprotected void createPropertyFields(AbstractClassMetaData acmd)
acmd
- MetaData for the class/interfaceprotected void createDefaultConstructor()
protected void createGetter(AbstractMemberMetaData mmd)
mmd
- MetaData for the propertyprotected void createSetter(AbstractMemberMetaData mmd)
mmd
- MetaData for the propertyCopyright © 2019. All rights reserved.