org.datanucleus.enhancer
Class AbstractImplementationGenerator

java.lang.Object
  extended by org.datanucleus.enhancer.AbstractImplementationGenerator
Direct Known Subclasses:
ASMImplementationGenerator, BCELImplementationGenerator

public abstract class AbstractImplementationGenerator
extends java.lang.Object

Abstract representation of a generator of implementations of abstract-classes/interfaces.


Field Summary
protected  byte[] bytes
          bytes for the implementation class.
protected  java.lang.String className
          Class name of the implementation.
protected  java.lang.String fullClassName
          Fully-qualified class name (including package) of the implementation.
protected  java.lang.String fullSuperclassName
          Class name for the superclass.
protected  org.datanucleus.metadata.AbstractClassMetaData inputCmd
          Meta data for the abstract-class/interface
 
Constructor Summary
AbstractImplementationGenerator(org.datanucleus.metadata.ClassMetaData classMetaData, java.lang.String implClassName)
          Constructor for an implementation of an abstract class.
AbstractImplementationGenerator(org.datanucleus.metadata.InterfaceMetaData interfaceMetaData, java.lang.String implClassName)
          Constructor for an implementation of an interface.
 
Method Summary
protected abstract  void createGetter(org.datanucleus.metadata.AbstractMemberMetaData mmd)
          Create a getter method for the specified property.
protected  void createPropertyFields()
          Creates fields for the properties of this class and super classes.
protected abstract  void createPropertyFields(org.datanucleus.metadata.AbstractClassMetaData acmd)
          Creates fields for the properties of the specified class/interface.
protected  void createPropertyMethods()
          Create getters and setters methods for this class and super classes
protected  void createPropertyMethods(org.datanucleus.metadata.AbstractClassMetaData acmd)
          Create getters and setters methods.
protected abstract  void createSetter(org.datanucleus.metadata.AbstractMemberMetaData mmd)
          Create a setter method for the specified property.
 void dumpToFile(java.lang.String filename)
          Convenience method to dump the generated class to the specified file.
abstract  void enhance(org.datanucleus.ClassLoaderResolver clr)
          Enhance the implementation for use in the persistence process.
 byte[] getBytes()
          Accessor for the byte representation of the generated class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

inputCmd

protected final org.datanucleus.metadata.AbstractClassMetaData inputCmd
Meta data for the abstract-class/interface


className

protected final java.lang.String className
Class name of the implementation.


fullClassName

protected final java.lang.String fullClassName
Fully-qualified class name (including package) of the implementation.


fullSuperclassName

protected java.lang.String fullSuperclassName
Class name for the superclass.


bytes

protected byte[] bytes
bytes for the implementation class.

Constructor Detail

AbstractImplementationGenerator

public AbstractImplementationGenerator(org.datanucleus.metadata.InterfaceMetaData interfaceMetaData,
                                       java.lang.String implClassName)
Constructor for an implementation of an interface.

Parameters:
interfaceMetaData - The MetaData for the interface
implClassName - Name of the implementation class to generate (omitting packages)

AbstractImplementationGenerator

public AbstractImplementationGenerator(org.datanucleus.metadata.ClassMetaData classMetaData,
                                       java.lang.String implClassName)
Constructor for an implementation of an abstract class.

Parameters:
classMetaData - The MetaData for the abstract class
implClassName - Name of the implementation class to generate (omitting packages)
Method Detail

enhance

public abstract void enhance(org.datanucleus.ClassLoaderResolver clr)
Enhance the implementation for use in the persistence process.

Parameters:
clr - ClassLoader Resolver

getBytes

public byte[] getBytes()
Accessor for the byte representation of the generated class.

Returns:
the byte representation of the class

createPropertyFields

protected void createPropertyFields()
Creates fields for the properties of this class and super classes.


createPropertyFields

protected abstract void createPropertyFields(org.datanucleus.metadata.AbstractClassMetaData acmd)
Creates fields for the properties of the specified class/interface.

Parameters:
acmd - MetaData for the class/interface

createPropertyMethods

protected void createPropertyMethods()
Create getters and setters methods for this class and super classes


createPropertyMethods

protected void createPropertyMethods(org.datanucleus.metadata.AbstractClassMetaData acmd)
Create getters and setters methods.

Parameters:
acmd - AbstractClassMetaData

createGetter

protected abstract void createGetter(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Create a getter method for the specified property.

Parameters:
mmd - MetaData for the property

createSetter

protected abstract void createSetter(org.datanucleus.metadata.AbstractMemberMetaData mmd)
Create a setter method for the specified property.

Parameters:
mmd - MetaData for the property

dumpToFile

public void dumpToFile(java.lang.String filename)
Convenience method to dump the generated class to the specified file.

Parameters:
filename -


Copyright © 2009. All Rights Reserved.