org.datanucleus.enhancer.asm.method
Class JdoIsXXX

java.lang.Object
  extended by org.datanucleus.enhancer.ClassMethod
      extended by org.datanucleus.enhancer.asm.ASMClassMethod
          extended by org.datanucleus.enhancer.asm.method.JdoIsXXX
Direct Known Subclasses:
JdoIsDeleted, JdoIsNew, JdoIsPersistent, JdoIsTransactional

public abstract class JdoIsXXX
extends ASMClassMethod

Base method to use for jdoIsXXX methods providing the majority of the enhancement.

Version:
$Revision: 1.3 $

Field Summary
 
Fields inherited from class org.datanucleus.enhancer.asm.ASMClassMethod
visitor
 
Fields inherited from class org.datanucleus.enhancer.ClassMethod
access, argNames, argTypes, enhancer, exceptions, LOCALISER, methodName, returnType
 
Constructor Summary
JdoIsXXX(ClassEnhancer enhancer, java.lang.String name, int access, java.lang.Object returnType, java.lang.Object[] argTypes, java.lang.String[] argNames)
          Constructor.
 
Method Summary
 void execute()
          Method to add the contents of the class method.
protected abstract  java.lang.String getStateManagerIsMethod()
          Method returning the name of the method on the StateManager that gives the return info.
 
Methods inherited from class org.datanucleus.enhancer.asm.ASMClassMethod
getClassEnhancer, getDescriptor, initialise, initialise
 
Methods inherited from class org.datanucleus.enhancer.ClassMethod
close, equals, getAccess, getMethodAdditionMessage, getName, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdoIsXXX

public JdoIsXXX(ClassEnhancer enhancer,
                java.lang.String name,
                int access,
                java.lang.Object returnType,
                java.lang.Object[] argTypes,
                java.lang.String[] argNames)
Constructor.

Parameters:
enhancer - ClassEnhancer
name - Name of method
access - Access type
returnType - Return type
argTypes - Argument types
argNames - Argument names
Method Detail

getStateManagerIsMethod

protected abstract java.lang.String getStateManagerIsMethod()
Method returning the name of the method on the StateManager that gives the return info.

Returns:
Name of the StateManager method (isNew, isPersistent, isDeleted etc)

execute

public void execute()
Method to add the contents of the class method. Creates the method as follows
 return jdoStateManager != null ? jdoStateManager.isXXX(this) : false;
 
where "isXXX" is replaced by the output of "getStateManagerIsMethod"

Specified by:
execute in class ClassMethod


Copyright © 2009. All Rights Reserved.