|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.persistence.dynamic.DynamicClassWriter
public class DynamicClassWriter
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.
Field Summary | |
---|---|
protected static java.lang.String |
CLINIT
|
protected static java.lang.String |
DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES
|
static int[] |
ICONST
|
protected static java.lang.String |
INIT
|
protected java.lang.Class<?> |
parentClass
|
protected java.lang.String |
parentClassName
Name of parent class. |
Constructor Summary | |
---|---|
DynamicClassWriter()
|
|
DynamicClassWriter(java.lang.Class<?> parentClass)
|
|
DynamicClassWriter(java.lang.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. |
Method Summary | |
---|---|
protected DynamicClassWriter |
createCopy(java.lang.Class<?> parentClass)
Create a copy of this DynamicClassWriter but with a different
parent class. |
protected byte[] |
createEnum(DynamicClassLoader.EnumInfo enumInfo)
|
protected java.lang.String[] |
getInterfaces()
Interfaces the dynamic entity class implements. |
java.lang.Class<?> |
getParentClass()
|
java.lang.String |
getParentClassName()
|
protected boolean |
isCompatible(DynamicClassWriter writer)
Verify that the provided writer is compatible with the current writer. |
java.lang.String |
toString()
|
protected boolean |
verify(java.lang.Class<?> dynamicClass,
java.lang.ClassLoader loader)
Verify that the provided class meets the requirements of the writer. |
byte[] |
writeClass(DynamicClassLoader loader,
java.lang.String className)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES
protected static final java.lang.String INIT
protected static final java.lang.String CLINIT
protected java.lang.Class<?> parentClass
protected java.lang.String parentClassName
public static int[] ICONST
Constructor Detail |
---|
public DynamicClassWriter()
public DynamicClassWriter(java.lang.Class<?> parentClass)
public DynamicClassWriter(java.lang.String parentClassName)
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.
getParentClass()
,
DynamicException.illegalDynamicClassWriter(DynamicClassLoader,
String)
Method Detail |
---|
public java.lang.Class<?> getParentClass()
public java.lang.String getParentClassName()
public byte[] writeClass(DynamicClassLoader loader, java.lang.String className) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException
protected byte[] createEnum(DynamicClassLoader.EnumInfo enumInfo)
protected boolean verify(java.lang.Class<?> dynamicClass, java.lang.ClassLoader loader) throws java.lang.ClassNotFoundException
DynamicClassWriter
this will ensure that the class is
a subclass of the parentClass
dynamicClass
-
java.lang.ClassNotFoundException
protected java.lang.String[] getInterfaces()
protected DynamicClassWriter createCopy(java.lang.Class<?> parentClass)
DynamicClassWriter
but with a different
parent class.
DynamicClassLoader.addClass(String, Class)
protected boolean isCompatible(DynamicClassWriter writer)
Used in DynamicClassLoader.addClass(String, DynamicClassWriter)
to verify if a duplicate request of the same className can proceed and
return the same class that may already exist.
public java.lang.String toString()
toString
in class java.lang.Object
|
EclipseLink 2.2.0, build 'v20110202-r8913' API Reference | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |