org.datanucleus.enhancer.asm.method
Class JdoMakeDirty
java.lang.Object
org.datanucleus.enhancer.ClassMethod
org.datanucleus.enhancer.asm.ASMClassMethod
org.datanucleus.enhancer.asm.method.JdoMakeDirty
public class JdoMakeDirty
- extends ASMClassMethod
Method to generate the method "jdoMakeDirty" using ASM.
public void jdoMakeDirty(String fieldName)
{
if (jdoStateManager != null)
jdoStateManager.makeDirty(this, fieldName);
if (jdoIsDetached() && fieldName != null)
{
String fldName = null;
if (fieldName.indexOf('.') >= 0)
fldName = fieldName.substring(fieldName.lastIndexOf('.') + 1);
else
fldName = fieldName;
for (int i = 0; i < jdoFieldNames.length; i++)
{
if (jdoFieldNames[i].equals(fldName))
{
if (((BitSet) jdoDetachedState[2]).get(i + jdoInheritedFieldCount))
((BitSet) jdoDetachedState[3]).set(i + jdoInheritedFieldCount);
else
throw new JDODetachedFieldAccessException
("You have just attempted to access a field/property");
break;
}
}
}
}
and if not detachable
public void jdoMakeDirty(String fieldName)
{
if (jdoStateManager != null)
jdoStateManager.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
JdoMakeDirty
public JdoMakeDirty(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
getInstance
public static JdoMakeDirty getInstance(ClassEnhancer enhancer)
execute
public void execute()
- Method to add the contents of the class method.
- Specified by:
execute in class ClassMethod
Copyright © 2012. All Rights Reserved.