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.
| Modifier and Type | Field and Description |
|---|---|
| protected static final String | |
| protected static final String | |
| public static int[] | |
| protected static final String | |
| private List | |
| protected Class | |
| protected String | parentClassName
Name of parent class. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| 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. |
| Modifier and Type | Method and Description |
|---|---|
| protected void | addFields(ClassWriter cw, String parentClassType)
Allow subclasses to add additional state to the dynamic entity. |
| protected void | addInterface(String
additional interface intf)Allow subclasses to add additional interfaces to the dynamic entity. |
| protected void | addMethods(ClassWriter cw, String parentClassType)
Allow subclasses to add additional methods to the dynamic entity. |
| protected DynamicClassWriter | createCopy(Class<?> parentClass)
Create a copy of this |
| protected byte[] | |
| protected String[] | Returns: Interfaces implemented by Dynamic class. May be nullInterfaces the dynamic entity class implements. |
| public Class | |
| private Class | getParentClass(ClassLoader loader)
Return the |
| public String | |
| public boolean | isCompatible(EclipseLinkClassWriter writer)
Implements org. |
| public String | |
| protected boolean | verify(Class<?> dynamicClass, ClassLoader loader)
Verify that the provided class meets the requirements of the writer. |
| public byte[] | writeClass(DynamicClassLoader loader, String className)
Implements org. |
| CLINIT | back to summary |
|---|---|
| protected static final String CLINIT | |
| DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES | back to summary |
|---|---|
| protected static final String DYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHES | |
| ICONST | back to summary |
|---|---|
| public static int[] ICONST | |
| INIT | back to summary |
|---|---|
| protected static final String INIT | |
| interfaces | back to summary |
|---|---|
| private List<String> interfaces | |
| parentClass | back to summary |
|---|---|
| protected Class<?> parentClass | |
| parentClassName | back to summary |
|---|---|
| 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. | |
| DynamicClassWriter | back to summary |
|---|---|
| public DynamicClassWriter() | |
| DynamicClassWriter | back to summary |
|---|---|
| public DynamicClassWriter(Class<?> parentClass) | |
| DynamicClassWriter | back to summary |
|---|---|
| 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. | |
| addFields | back to summary |
|---|---|
| protected void addFields(ClassWriter cw, String parentClassType) Allow subclasses to add additional state to the dynamic entity. | |
| addInterface | back to summary |
|---|---|
| protected void addInterface(String intf) Allow subclasses to add additional interfaces to the dynamic entity.
| |
| addMethods | back to summary |
|---|---|
| protected void addMethods(ClassWriter cw, String parentClassType) Allow subclasses to add additional methods to the dynamic entity. | |
| createCopy | back to summary |
|---|---|
| protected DynamicClassWriter createCopy(Class<?> parentClass) Create a copy of this | |
| createEnum | back to summary |
|---|---|
| protected byte[] createEnum(DynamicClassLoader. | |
| getInterfaces | back to summary |
|---|---|
| protected String[] getInterfaces() Interfaces the dynamic entity class implements. By default this is none but in the case of SDO a concrete interface must be implemented. Subclasses should override this as required.
| |
| getParentClass | back to summary |
|---|---|
| public Class Implements org.
| |
| getParentClass | back to summary |
|---|---|
| private Class Return the
| |
| getParentClassName | back to summary |
|---|---|
| public String getParentClassName() Implements org.
| |
| isCompatible | back to summary |
|---|---|
| public boolean isCompatible(EclipseLinkClassWriter writer) Implements org. Verify that the provided writer is compatible with the current writer. Returning true means that the bytes that would be created using this writer are identical with what would come from the provided writer.
Used in
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| verify | back to summary |
|---|---|
| protected boolean verify(Class<?> dynamicClass, ClassLoader loader) throws ClassNotFoundException Verify that the provided class meets the requirements of the writer. In
the case of | |
| writeClass | back to summary |
|---|---|
| public byte[] writeClass(DynamicClassLoader loader, String className) throws ClassNotFoundException Implements org.
| |