Class DynamicClassWriter

java.lang.Object
org.eclipse.persistence.dynamic.DynamicClassWriter
All Implemented Interfaces:
EclipseLinkClassWriter

public class DynamicClassWriter extends Object implements EclipseLinkClassWriter
Write the byte codes of a dynamic entity class. The class writer will create the byte codes for a dynamic class that subclasses any provided class replicating its constructors and writeReplace method (if one exists).

The intent is to provide a common writer for dynamic JPA entities but also allow for subclasses of this to be used in more complex writing situations such as SDO and DBWS.

Instances of this class and any subclasses are maintained within the DynamicClassLoader.getClassWriters() and DynamicClassLoader.defaultWriter for the life of the class loader so it is important that no unnecessary state be maintained that may effect memory usage.

Author:
dclarke, mnorman
  • Field Details

    • DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES

      protected static final String DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES
    • INIT

      protected static final String INIT
      See Also:
    • CLINIT

      protected static final String CLINIT
      See Also:
    • parentClass

      protected Class<?> parentClass
    • parentClassName

      protected String parentClassName
      Name of parent class. This is used only when the parent class is not known at the time the dynamic class writer is registered. This is generally only required when loading from an XML mapping file where the order of class access is not known.
    • ICONST

      public static int[] ICONST
  • Constructor Details

    • DynamicClassWriter

      public DynamicClassWriter()
    • DynamicClassWriter

      public DynamicClassWriter(Class<?> parentClass)
    • DynamicClassWriter

      public DynamicClassWriter(String parentClassName)
      Create using a loader and class name so that the parent class can be lazily loaded when the writer is used to generate a dynamic class.

      The loader must not be null and the parentClassName must not be null and not an empty String. The parentClassName will be converted to a class using the provided loader lazily.

      See Also:
  • Method Details