org.eclipse.persistence.internal.jpa.weaving.MethodWeaver
| Modifier and Type | Field and Description |
|---|---|
| protected boolean | |
| public static final String | |
| protected ClassDetails | classDetails
Stores information on the class gathered from the temp class loader and descriptor. |
| public static final String | |
| public static final String | |
| private ClassVisitor | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| private static Boolean | isJAXBOnPath
Store if JAXB is on the classpath, true in Java SE 6 - 8, maybe true from 9 |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public static final String | |
| public boolean | |
| public static final String | |
| public static final String | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public boolean | |
| public static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | |
| public void | |
| public void | addGetPropertyChangeListener(ClassDetails classDetails)
Add the implementation of the changeTracker_getPropertyChangeListener method to the class. |
| public void | addGetterMethodForFieldAccess(ClassDetails classDetails, AttributeDetails attributeDetails)
Adds a convenience method used to replace a GETFIELD when field access is used. |
| public void | addGetterMethodForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails)
Add a get method for the newly added valueholder. |
| public void | addInitializerForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails)
Add a method that allows us to lazily initialize a valueholder we have woven in This allows us to avoid initializing valueholders in the constructor. |
| public void | addPersistenceEntityMethods(ClassDetails classDetails)
Adds get/set method for PersistenceEntity interface. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | addPropertyChangeListener(boolean attributeAccess)
Add a variable of type PropertyChangeListener to the class. |
| public void | addSetPropertyChangeListener(ClassDetails classDetails)
Add the implementation of the changeTracker_setPropertyChangeListener method to the class. |
| public void | addSetterMethodForFieldAccess(ClassDetails classDetails, AttributeDetails attributeDetails)
Adds a convenience method used to replace a PUTFIELD when field access is used. |
| public void | addSetterMethodForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails)
Add a set method for the newly added ValueHolder. |
| public void | |
| public void | addValueHolder(AttributeDetails attributeDetails)
Add a variable of type ValueHolderInterface to the class. |
| public static String | getWeavedValueHolderGetMethodName(String attributeName)
Return the get method name weaved for a value-holder attribute. |
| public static String | getWeavedValueHolderSetMethodName(String attributeName)
Return the set method name weaved for a value-holder attribute. |
| public static boolean | isJAXBOnPath()
Return if the JAXB classes are on the classpath (if they are the XmlTransient annotation is added). |
| public static void | |
| public void | |
| public AnnotationVisitor | visitAnnotation(String desc, boolean visible)
Overrides org. |
| public void | visitEnd()
Overrides org. |
| public FieldVisitor | visitField(int access, String name, String desc, String signature, Object value)
Overrides org. |
| public MethodVisitor | visitMethod(int access, String methodName, String desc, String signature, String[] exceptions)
Overrides org. |
| public static String |
| alreadyWeaved | back to summary |
|---|---|
| protected boolean alreadyWeaved | |
| CACHEKEY_SIGNATURE | back to summary |
|---|---|
| public static final String CACHEKEY_SIGNATURE | |
| classDetails | back to summary |
|---|---|
| protected ClassDetails classDetails Stores information on the class gathered from the temp class loader and descriptor. | |
| CLONEABLE_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String CLONEABLE_SHORT_SIGNATURE | |
| CT_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String CT_SHORT_SIGNATURE | |
| cw | back to summary |
|---|---|
| private ClassVisitor cw | |
| ENTITY_MANAGER_IMPL_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String ENTITY_MANAGER_IMPL_SHORT_SIGNATURE | |
| FETCHGROUP_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String FETCHGROUP_SHORT_SIGNATURE | |
| FETCHGROUP_SIGNATURE | back to summary |
|---|---|
| public static final String FETCHGROUP_SIGNATURE | |
| FETCHGROUP_TRACKER_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String FETCHGROUP_TRACKER_SHORT_SIGNATURE | |
| FETCHGROUP_TRACKER_SIGNATURE | back to summary |
|---|---|
| public static final String FETCHGROUP_TRACKER_SIGNATURE | |
| isJAXBOnPath | back to summary |
|---|---|
| private static Boolean isJAXBOnPath Store if JAXB is on the classpath, true in Java SE 6 - 8, maybe true from 9 | |
| ITEM_LINKS_SIGNATURE | back to summary |
|---|---|
| public static final String ITEM_LINKS_SIGNATURE | |
| JPA_TRANSIENT_DESCRIPTION | back to summary |
|---|---|
| public static final String JPA_TRANSIENT_DESCRIPTION | |
| LINK_SIGNATURE | back to summary |
|---|---|
| public static final String LINK_SIGNATURE | |
| LIST_RELATIONSHIP_INFO_GENERIC_SIGNATURE | back to summary |
|---|---|
| public static final String LIST_RELATIONSHIP_INFO_GENERIC_SIGNATURE | |
| LIST_RELATIONSHIP_INFO_SIGNATURE | back to summary |
|---|---|
| public static final String LIST_RELATIONSHIP_INFO_SIGNATURE | |
| LONG_SIGNATURE | back to summary |
|---|---|
| public static final String LONG_SIGNATURE | |
| OBJECT_SIGNATURE | back to summary |
|---|---|
| public static final String OBJECT_SIGNATURE | |
| PBOOLEAN_SIGNATURE | back to summary |
|---|---|
| public static final String PBOOLEAN_SIGNATURE | |
| PCE_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String PCE_SHORT_SIGNATURE | |
| PCE_SIGNATURE | back to summary |
|---|---|
| public static final String PCE_SIGNATURE | |
| PCL_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String PCL_SHORT_SIGNATURE | |
| PCL_SIGNATURE | back to summary |
|---|---|
| public static final String PCL_SIGNATURE | |
| PERSISTENCE_ENTITY_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String PERSISTENCE_ENTITY_SHORT_SIGNATURE | |
| PERSISTENCE_FIELDNAME_POSTFIX | back to summary |
|---|---|
| public static final String PERSISTENCE_FIELDNAME_POSTFIX | |
| PERSISTENCE_FIELDNAME_PREFIX | back to summary |
|---|---|
| public static final String PERSISTENCE_FIELDNAME_PREFIX | |
| PERSISTENCE_GET | back to summary |
|---|---|
| public static final String PERSISTENCE_GET | |
| PERSISTENCE_OBJECT_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String PERSISTENCE_OBJECT_SHORT_SIGNATURE | |
| PERSISTENCE_OBJECT_SIGNATURE | back to summary |
|---|---|
| public static final String PERSISTENCE_OBJECT_SIGNATURE | |
| PERSISTENCE_SET | back to summary |
|---|---|
| public static final String PERSISTENCE_SET | |
| PERSISTENCE_WEAVED_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String PERSISTENCE_WEAVED_SHORT_SIGNATURE | |
| SESSION_SIGNATURE | back to summary |
|---|---|
| public static final String SESSION_SIGNATURE | |
| STRING_SIGNATURE | back to summary |
|---|---|
| public static final String STRING_SIGNATURE | |
| TW_CT_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String TW_CT_SHORT_SIGNATURE | |
| TW_LAZY_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String TW_LAZY_SHORT_SIGNATURE | |
| VECTOR_SIGNATURE | back to summary |
|---|---|
| public static final String VECTOR_SIGNATURE | |
| VH_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String VH_SHORT_SIGNATURE | |
| VHI_CLASSNAME | back to summary |
|---|---|
| public static final String VHI_CLASSNAME | |
| VHI_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String VHI_SHORT_SIGNATURE | |
| VHI_SIGNATURE | back to summary |
|---|---|
| public static final String VHI_SIGNATURE | |
| VIRTUAL_GETTER_SIGNATURE | back to summary |
|---|---|
| public static final String VIRTUAL_GETTER_SIGNATURE | |
| VIRTUAL_SETTER_SIGNATURE | back to summary |
|---|---|
| public static final String VIRTUAL_SETTER_SIGNATURE | |
| weaved | back to summary |
|---|---|
| public boolean weaved | |
| WEAVED_FETCHGROUPS_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String WEAVED_FETCHGROUPS_SHORT_SIGNATURE | |
| WEAVED_REST_LAZY_SHORT_SIGNATURE | back to summary |
|---|---|
| public static final String WEAVED_REST_LAZY_SHORT_SIGNATURE | |
| weavedChangeTracker | back to summary |
|---|---|
| public boolean weavedChangeTracker | |
| weavedFetchGroups | back to summary |
|---|---|
| public boolean weavedFetchGroups | |
| weavedLazy | back to summary |
|---|---|
| public boolean weavedLazy | |
| weavedPersistenceEntity | back to summary |
|---|---|
| public boolean weavedPersistenceEntity | |
| weavedRest | back to summary |
|---|---|
| public boolean weavedRest | |
| XML_TRANSIENT_DESCRIPTION | back to summary |
|---|---|
| public static final String XML_TRANSIENT_DESCRIPTION | |
| ClassWeaver | back to summary |
|---|---|
| public ClassWeaver(ClassVisitor classWriter, ClassDetails classDetails) | |
| addFetchGroupMethods | back to summary |
|---|---|
| public void addFetchGroupMethods(ClassDetails classDetails) Adds get/set method for FetchGroupTracker interface. This adds the following methods: public Session _persistence_getSession() { return _persistence_session; } public void _persistence_setSession(Session session) { this._persistence_session = session; } public FetchGroup _persistence_getFetchGroup() { return _persistence_fetchGroup; } public void _persistence_setFetchGroup(FetchGroup fetchGroup) { this._persistence_fetchGroup = fetchGroup; } public boolean _persistence_shouldRefreshFetchGroup() { return _persistence_shouldRefreshFetchGroup; } public void _persistence_setShouldRefreshFetchGroup(boolean shouldRefreshFetchGroup) { this._persistence_shouldRefreshFetchGroup = shouldRefreshFetchGroup; } public void _persistence_resetFetchGroup() { } public void _persistence_isAttributeFetched(String attribute) { return this._persistence_fetchGroup == null || _persistence_fetchGroup.containsAttribute(attribute); } public void _persistence_checkFetched(String attribute) { if (this._persistence_fetchGroup != null) { EntityManagerImpl.processUnfetchedAttribute(this, attribute); } } public void _persistence_checkSetFetched(String attribute) { if (this._persistence_fetchGroup != null) { EntityManagerImpl.processUnfetchedAttributeForSet(this, attribute); } } | |
| addFetchGroupVariables | back to summary |
|---|---|
| public void addFetchGroupVariables() Add a variable of type FetchGroup, Session to the class. When this method has been run, the class will contain a variable declarations similar to the following: private FetchGroup _persistence_fetchGroup; private boolean _persistence_shouldRefreshFetchGroup; private Session _persistence_session; | |
| addGetPropertyChangeListener | back to summary |
|---|---|
| public void addGetPropertyChangeListener(ClassDetails classDetails) Add the implementation of the changeTracker_getPropertyChangeListener method to the class. The result is a method that looks as follows: public PropertyChangeListener _persistence_getPropertyChangeListener() { return _persistence_listener; } | |
| addGetterMethodForFieldAccess | back to summary |
|---|---|
| public void addGetterMethodForFieldAccess(ClassDetails classDetails, AttributeDetails attributeDetails) Adds a convenience method used to replace a GETFIELD when field access is used. The method follows the following form: public (VariableClass) _persistence_get_variableName() { _persistence_checkFetched("variableName"); _persistence_initialize_variableName_vh(); this.variableName = ((VariableClass))_persistence_variableName_vh.getValue(); return this.variableName; } | |
| addGetterMethodForValueHolder | back to summary |
|---|---|
| public void addGetterMethodForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails) Add a get method for the newly added valueholder. Adds a method of the following form: public WeavedAttributeValueHolderInterface _persistence_getfoo_vh(){ _persistence_initialize_attributeName_vh(); if (_persistence_vh.isCoordinatedWithProperty() || _persistence_foo_vh.isNewlyWeavedValueHolder()){ EntityC object = (EntityC)getFoo(); if (object != _persistence_foo_vh.getValue()){ setFoo(object); } } return _persistence_foo_vh; } | |
| addInitializerForValueHolder | back to summary |
|---|---|
| public void addInitializerForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails) Add a method that allows us to lazily initialize a valueholder we have woven in This allows us to avoid initializing valueholders in the constructor. protected void _persistence_initialize_attribute_vh(){ if(_persistence_attribute_vh == null){ _persistence_attribute_vh = new ValueHolder(this.attribute); // or new ValueHolder() if property access. _persistence_attribute_vh.setIsNewlyWeavedValueHolder(true); } } | |
| addPersistenceEntityMethods | back to summary |
|---|---|
| public void addPersistenceEntityMethods(ClassDetails classDetails) Adds get/set method for PersistenceEntity interface. This adds the following methods: public Object _persistence_getId() { return _persistence_primaryKey; } public void _persistence_setId(Object primaryKey) { this._persistence_primaryKey = primaryKey; } | |
| addPersistenceEntityVariables | back to summary |
|---|---|
| public void addPersistenceEntityVariables() Add a variable of type Object to the class. When this method has been run, the class will contain a variable declarations similar to the following: private Object _persistence_primaryKey; | |
| addPersistenceGetSet | back to summary |
|---|---|
| public void addPersistenceGetSet(ClassDetails classDetails) Add an internal generic get and set method. This is used to avoid reflection. public Object _persistence_get(String attribute) { if (attribute == "address") { return this.address; } if (attribute == "city") { return this.city; } return null; } public void _persistence_set(int index, Object value) { if (attribute == "address") { this.address = (String)value; } else if (attribute == "city") { this.city = (String)city; } } | |
| addPersistenceNew | back to summary |
|---|---|
| public void addPersistenceNew(ClassDetails classDetails) Add an internal empty constructor, and new method. This is used to avoid unnecessary initialization and avoid reflection. public void _persistence_new(PersistenceObject factory) { return new ClassType(factory); } public ClassType(PersistenceObject factory) { super(); } | |
| addPersistencePostClone | back to summary |
|---|---|
| public void addPersistencePostClone(ClassDetails classDetails) Add an internal post clone method. This will clone value holders to avoid change original/clone to effect the other. public Object _persistence_post_clone() { this._attribute_vh = this._attribute_vh.clone(); ... this._persistence_listener = null; return this; } | |
| addPersistenceRestMethods | back to summary |
|---|---|
| public void addPersistenceRestMethods(ClassDetails classDetails) | |
| addPersistenceRestVariables | back to summary |
|---|---|
| public void addPersistenceRestVariables() | |
| addPropertyChange | back to summary |
|---|---|
| public void addPropertyChange(ClassDetails classDetails) Add a method to track property changes. The method will look as follows: public void _toplink_propertyChange(String s, Object obj, Object obj1){ if(_persistence_listener != null && obj != obj1){ _persistence_listener.propertyChange(new PropertyChangeEvent(this, s, obj, obj1)); } } | |
| addPropertyChangeListener | back to summary |
|---|---|
| public void addPropertyChangeListener(boolean attributeAccess) Add a variable of type PropertyChangeListener to the class. When this method has been run, the class will contain a variable declaration similar to the following private transient _persistence_listener; | |
| addSetPropertyChangeListener | back to summary |
|---|---|
| public void addSetPropertyChangeListener(ClassDetails classDetails) Add the implementation of the changeTracker_setPropertyChangeListener method to the class. The result is a method that looks as follows: public void _persistence_setPropertyChangeListener(PropertyChangeListener propertychangelistener){ _persistence_listener = propertychangelistener; } | |
| addSetterMethodForFieldAccess | back to summary |
|---|---|
| public void addSetterMethodForFieldAccess(ClassDetails classDetails, AttributeDetails attributeDetails) Adds a convenience method used to replace a PUTFIELD when field access is used. The method follows the following form: public void _persistence_set_variableName((VariableClas) argument) { _persistence_checkFetchedForSet("variableName"); _persistence_initialize_variableName_vh(); _persistence_propertyChange("variableName", this.variableName, argument); // if change tracking enabled, wrapping primitives, i.e. Long.valueOf(item) this.variableName = argument; _persistence_variableName_vh.setValue(variableName); // if lazy enabled } | |
| addSetterMethodForValueHolder | back to summary |
|---|---|
| public void addSetterMethodForValueHolder(ClassDetails classDetails, AttributeDetails attributeDetails) Add a set method for the newly added ValueHolder. Adds a method of this form: public void _persistence_setfoo_vh(WeavedAttributeValueHolderInterface valueholderinterface){ _persistence_foo_vh = valueholderinterface; if (valueholderinterface.isInstantiated()){ Object object = getFoo(); Object value = valueholderinterface.getValue(); if (object != value){ setFoo((EntityC)value); } } else { foo = null; } } | |
| addShallowClone | back to summary |
|---|---|
| public void addShallowClone(ClassDetails classDetails) Add an internal shallow clone method. This can be used to optimize uow cloning. public Object _persistence_shallow_clone() { return super.clone(); } | |
| addValueHolder | back to summary |
|---|---|
| public void addValueHolder(AttributeDetails attributeDetails) Add a variable of type ValueHolderInterface to the class. When this method has been run, the class will contain a variable declaration similar to the following: private ValueHolderInterface _persistence_variableName_vh; | |
| getWeavedValueHolderGetMethodName | back to summary |
|---|---|
| public static String getWeavedValueHolderGetMethodName(String attributeName) Return the get method name weaved for a value-holder attribute. | |
| getWeavedValueHolderSetMethodName | back to summary |
|---|---|
| public static String getWeavedValueHolderSetMethodName(String attributeName) Return the set method name weaved for a value-holder attribute. | |
| isJAXBOnPath | back to summary |
|---|---|
| public static boolean isJAXBOnPath() Return if the JAXB classes are on the classpath (if they are the XmlTransient annotation is added). | |
| unwrapPrimitive | back to summary |
|---|---|
| public static void unwrapPrimitive(AttributeDetails attribute, MethodVisitor visitor) Used for primitive conversion. Returns the name conversion method for the given type. | |
| visit | back to summary |
|---|---|
| public void visit(int version, int access, String name, String signature, String superName, String[] interfaces) Overrides org. Visit the class byte-codes and modify to weave Persistence interfaces. This add PersistenceWeaved, PersistenceWeavedLazy, PersistenceWeavedChangeTracking, PersistenceEntity, ChangeTracker. The new interfaces are pass to the super weaver.
| |
| visitAnnotation | back to summary |
|---|---|
| public AnnotationVisitor visitAnnotation(String desc, boolean visible) Overrides org.
| |
| visitEnd | back to summary |
|---|---|
| public void visitEnd() Overrides org. Visit the end of the class byte codes. Add any new methods or variables to the end.
| |
| visitField | back to summary |
|---|---|
| public FieldVisitor visitField(int access, String name, String desc, String signature, Object value) Overrides org.
| |
| visitMethod | back to summary |
|---|---|
| public MethodVisitor visitMethod(int access, String methodName, String desc, String signature, String[] exceptions) Overrides org. Construct a MethodWeaver and allow it to process the method.
| |
| wrapperFor | back to summary |
|---|---|
| public static String wrapperFor(int sort) Used for primitive conversion. Returns the name of the class that wraps a given type. | |