Top Description Fields Constructors Methods
org.eclipse.persistence.internal.jpa.metadata

public Class MetadataDynamicClassWriter

extends DynamicClassWriter
Class Inheritance
Imports
org.eclipse.persistence.asm.ASMFactory, .ClassWriter, .MethodVisitor, .Opcodes, .Type, org.eclipse.persistence.dynamic.DynamicClassWriter, org.eclipse.persistence.internal.helper.ClassConstants, org.eclipse.persistence.internal.jpa.metadata.accessors.mappings.MappingAccessor

Custom DynamicClassWriter adding getter methods for virtual attributes so that 3rd party frameworks such as jakarta.validation can access the attribute values.
Author
dclarke
Since
EclipseLink 2.4.1

Field Summary

Modifier and TypeField and Description
private MetadataDescriptor
descriptor

The MetadataDescriptor for the dynamic entity

private static final String
private static final String
private static final String
private static final String
private static final String
private static final String
Inherited from org.eclipse.persistence.dynamic.DynamicClassWriter:
CLINITDYNAMIC_PROPERTIES_MANAGER_CLASSNAME_SLASHESICONSTINITparentClassparentClassName

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected void
addMethods(ClassWriter cw, String parentClassType)

Overrides org.eclipse.persistence.dynamic.DynamicClassWriter.addMethods.

Add get methods for all virtual attributes
private Type
getAsmType(MappingAccessor accessor)

Get the Type for the accessor.

public MetadataDescriptor
private String
propertyName(String attributeName)

Convert attribute name into property name to be used in get/set method names by upper casing first letter.

Inherited from org.eclipse.persistence.dynamic.DynamicClassWriter:
addFieldsaddInterfacecreateCopycreateEnumgetInterfacesgetParentClassgetParentClassNameisCompatibletoStringverifywriteClass

Field Detail

descriptorback to summary
private MetadataDescriptor descriptor

The MetadataDescriptor for the dynamic entity

DYNAMIC_EXCEPTIONback to summary
private static final String DYNAMIC_EXCEPTION
GETback to summary
private static final String GET
LDYNAMIC_ENTITYback to summary
private static final String LDYNAMIC_ENTITY
LJAVA_LANG_OBJECTback to summary
private static final String LJAVA_LANG_OBJECT
LJAVA_LANG_STRINGback to summary
private static final String LJAVA_LANG_STRING
SETback to summary
private static final String SET

Constructor Detail

MetadataDynamicClassWriterback to summary
public MetadataDynamicClassWriter(MetadataDescriptor descriptor)

Method Detail

addMethodsback to summary
protected void addMethods(ClassWriter cw, String parentClassType)

Overrides org.eclipse.persistence.dynamic.DynamicClassWriter.addMethods.

Add get methods for all virtual attributes

Annotations
@Override
getAsmTypeback to summary
private Type getAsmType(MappingAccessor accessor)

Get the Type for the accessor. If the accessor's type is primitive return the the non-primitive type.

getDescriptorback to summary
public MetadataDescriptor getDescriptor()
propertyNameback to summary
private String propertyName(String attributeName)

Convert attribute name into property name to be used in get/set method names by upper casing first letter.