Package org.datanucleus.enhancer.methods
Class MakeDirty
- java.lang.Object
-
- org.datanucleus.enhancer.ClassMethod
-
- org.datanucleus.enhancer.methods.MakeDirty
-
public class MakeDirty extends ClassMethod
Method to generate the method "dnMakeDirty" using ASM.public void dnMakeDirty(String fieldName) { if (dnStateManager != null) dnStateManager.makeDirty(this, fieldName); if (dnIsDetached() && fieldName != null) { String fldName = null; if (fieldName.indexOf('.') ≥ 0) fldName = fieldName.substring(fieldName.lastIndexOf('.') + 1); else fldName = fieldName; for (int i = 0; i < dnFieldNames.length; i++) { if (dnFieldNames[i].equals(fldName)) { if (((BitSet) dnDetachedState[2]).get(i + dnInheritedFieldCount)) ((BitSet) dnDetachedState[3]).set(i + dnInheritedFieldCount); else throw new JDODetachedFieldAccessException("You have just attempted to access a field/property"); break; } } } }
and if not detachablepublic void dnMakeDirty(String fieldName) { if (dnStateManager != null) dnStateManager.makeDirty(this, fieldName); }
TODO This currently doesnt cater for a fully-qualified field where the class name part doesnt define a field at that level
-
-
Field Summary
-
Fields inherited from class org.datanucleus.enhancer.ClassMethod
access, argNames, argTypes, enhancer, exceptions, methodName, returnType, visitor
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute()
Method to add the contents of the class method.static MakeDirty
getInstance(ClassEnhancer enhancer)
-
Methods inherited from class org.datanucleus.enhancer.ClassMethod
close, equals, getAccess, getClassEnhancer, getDescriptor, getMethodAdditionMessage, getName, getNamer, hashCode, initialise, initialise
-
-
-
-
Constructor Detail
-
MakeDirty
public MakeDirty(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames)
Constructor.- Parameters:
enhancer
- ClassEnhancername
- Name of methodaccess
- Access typereturnType
- Return typeargTypes
- Argument typesargNames
- Argument names
-
-
Method Detail
-
getInstance
public static MakeDirty getInstance(ClassEnhancer enhancer)
-
execute
public void execute()
Method to add the contents of the class method.- Specified by:
execute
in classClassMethod
-
-