| Modifier and Type | Field and Description |
|---|---|
| protected String | |
| protected String | |
| protected boolean | methodStarted
Determines if we are at the first line of a method. |
| protected ClassWeaver |
| Access | Constructor and Description |
|---|---|
| public |
| methodDescriptor | back to summary |
|---|---|
| protected String methodDescriptor | |
| methodName | back to summary |
|---|---|
| protected String methodName | |
| methodStarted | back to summary |
|---|---|
| protected boolean methodStarted Determines if we are at the first line of a method. | |
| tcw | back to summary |
|---|---|
| protected ClassWeaver tcw | |
| MethodWeaver | back to summary |
|---|---|
| public MethodWeaver(ClassWeaver tcw, String methodName, String methodDescriptor, MethodVisitor mv) | |
| visitAnnotation | back to summary |
|---|---|
| public AnnotationVisitor visitAnnotation(String desc, boolean visible) Overrides org.
| |
| visitAttribute | back to summary |
|---|---|
| public void visitAttribute(final Attribute attr) Overrides org.
| |
| visitEnd | back to summary |
|---|---|
| public void visitEnd() Overrides org.
| |
| visitFieldInsn | back to summary |
|---|---|
| public void visitFieldInsn(final int opcode, final String owner, final String name, final String desc) Overrides org.
| |
| visitIincInsn | back to summary |
|---|---|
| public void visitIincInsn(final int var, final int increment) Overrides org.
| |
| visitInsn | back to summary |
|---|---|
| public void visitInsn(final int opcode) Overrides org.
| |
| visitIntInsn | back to summary |
|---|---|
| public void visitIntInsn(final int opcode, final int operand) Overrides org.
| |
| visitJumpInsn | back to summary |
|---|---|
| public void visitJumpInsn(final int opcode, final Label label) Overrides org.
| |
| visitLabel | back to summary |
|---|---|
| public void visitLabel(final Label label) Overrides org.
| |
| visitLdcInsn | back to summary |
|---|---|
| public void visitLdcInsn(final Object cst) Overrides org.
| |
| visitLineNumber | back to summary |
|---|---|
| public void visitLineNumber(final int line, final Label start) Overrides org.
| |
| visitLocalVariable | back to summary |
|---|---|
| public void visitLocalVariable(final String name, final String desc, String signature, final Label start, final Label end, final int index) Overrides org.
| |
| visitLookupSwitchInsn | back to summary |
|---|---|
| public void visitLookupSwitchInsn(final Label dflt, final int[] keys, final Label[] labels) Overrides org.
| |
| visitMaxs | back to summary |
|---|---|
| public void visitMaxs(final int maxStack, final int maxLocals) Overrides org.
| |
| visitMethodInsn | back to summary |
|---|---|
| public void visitMethodInsn(final int opcode, final String owner, final String name, final String desc, boolean intf) Overrides org.
| |
| visitMultiANewArrayInsn | back to summary |
|---|---|
| public void visitMultiANewArrayInsn(final String desc, final int dims) Overrides org.
| |
| visitTableSwitchInsn | back to summary |
|---|---|
| public void visitTableSwitchInsn(final int min, final int max, final Label dflt, final Label... labels) Overrides org.
| |
| visitTryCatchBlock | back to summary |
|---|---|
| public void visitTryCatchBlock(final Label start, final Label end, final Label handler, final String type) Overrides org.
| |
| visitTypeInsn | back to summary |
|---|---|
| public void visitTypeInsn(final int opcode, final String desc) Overrides org.
| |
| visitVarInsn | back to summary |
|---|---|
| public void visitVarInsn(final int opcode, final int var) Overrides org.
| |
| weaveAttributesIfRequired | back to summary |
|---|---|
| public void weaveAttributesIfRequired(int opcode, String owner, String name, String desc) Change GETFIELD and PUTFIELD for fields that use attribute access to make use of new convenience methods. A GETFIELD for an attribute named 'variableName' will be replaced by a call to: _persistence_get_variableName() A PUTFIELD for an attribute named 'variableName' will be replaced by a call to: _persistence_set_variableName(variableName) | |
| weaveBeginningOfMethodIfRequired | back to summary |
|---|---|
| public void weaveBeginningOfMethodIfRequired() Makes modifications to the beginning of a method. 1. Modifies getter method for attributes using property access In a getter method for 'attributeName', the following lines are added at the beginning of the method _persistence_checkFetched("attributeName"); _persistence_initialize_attributeName_vh(); if (!_persistence_attributeName_vh.isInstantiated()) { PropertyChangeListener temp_persistence_listener = _persistence_listener; _persistence_listener = null; setAttributeName((AttributeType)_persistence_attributeName_vh.getValue()); _persistence_listener = temp_persistence_listener; } 2. Modifies setter methods to store old value of attribute If weaving for fetch groups: // if weaving for change tracking: if(_persistence_listener != null) // for Objects AttributeType oldAttribute = getAttribute() // for primitives AttributeWrapperType oldAttribute = new AttributeWrapperType(getAttribute()); e.g. Double oldAttribute = Double.valueOf(getAttribute()); else _persistence_checkFetchedForSet("attributeName"); _persistence_propertyChange("attributeName", oldAttribute, argument); otherwise (not weaving for fetch groups): // for Objects AttributeType oldAttribute = getAttribute() // for primitives AttributeWrapperType oldAttribute = new AttributeWrapperType(getAttribute()); e.g. Double oldAttribute = Double.valueOf(getAttribute()); _persistence_propertyChange("attributeName", oldAttribute, argument); // if not weaving for change tracking, but for fetch groups only: _persistence_checkFetchedForSet("attributeName"); 3. Modifies getter Method for attributes using virtual access add: _persistence_checkFetched(name); 4. Modifies setter Method for attributes using virtual access add code of the following form: Object obj = null; if(_persistence_listener != null){ obj = get(name); } else { _persistence_checkFetchedForSet(name); } _persistence_propertyChange(name, obj, value); _persistence_checkFetchedForSet(name) call will be excluded if weaving of fetch groups is not enabled _persistence_propertyChange(name, obj, value); will be excluded if weaving of change tracking is not enabled | |
| weaveEndOfMethodIfRequired | back to summary |
|---|---|
| public void weaveEndOfMethodIfRequired() Modifies methods just before the return. In a setter method for a LAZY mapping, for 'attributeName', the following lines are added at the end of the method. _persistence_initialize_attributeName_vh(); _persistence_attributeName_vh.setValue(argument); _persistence_attributeName_vh.setIsCoordinatedWithProperty(true); In a setter method for a non-LAZY mapping, the followings lines are added if change tracking is activated: _persistence_propertyChange("attributeName", oldAttribute, argument); Note: This code will wrap primitives by adding a call to the primitive constructor. | |