- java.lang.Object
- 
- org.datanucleus.enhancer.ClassMethod
 
- 
- Direct Known Subclasses:
- Clone,- CopyField,- CopyFields,- CopyKeyFieldsFromObjectId,- CopyKeyFieldsFromObjectId2,- CopyKeyFieldsToObjectId,- CopyKeyFieldsToObjectId2,- DefaultConstructor,- GetExecutionContext,- GetInheritedFieldCount,- GetManagedFieldCount,- GetNormal,- GetObjectId,- GetStateManager,- GetTransactionalObjectId,- GetVersion,- GetViaCheck,- GetViaMediate,- InitClass,- InitFieldNames,- IsDetached,- IsDirty,- IsXXX,- LoadClass,- MakeDirty,- NewInstance1,- NewInstance2,- NewObjectIdInstance1,- NewObjectIdInstance2,- PreSerialize,- ProvideField,- ProvideFields,- ReplaceDetachedState,- ReplaceField,- ReplaceFields,- ReplaceFlags,- ReplaceStateManager,- SetNormal,- SetViaCheck,- SetViaMediate,- WriteObject
 
 public abstract class ClassMethod extends Object Representation of a method that an enhanced class requires.
- 
- 
Field SummaryFields Modifier and Type Field Description protected intaccessAccess flags for the method (public, protected etc).protected String[]argNamesNames of the arguments.protected Object[]argTypesTypes of the arguments.protected ClassEnhancerenhancerThe parent enhancer.protected String[]exceptionsExceptions that can be thrown.protected StringmethodNameName of the method.protected ObjectreturnTypeReturn type for the methodprotected MethodVisitorvisitorVisitor for use in updating the method of the class (set in initialise).
 - 
Constructor SummaryConstructors Constructor Description ClassMethod(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames)Constructor.ClassMethod(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames, String[] exceptions)Constructor.
 - 
Method SummaryAll Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidclose()Method to close the definition of the class method.booleanequals(Object o)Indicates whether some other object is "equal to" this one.abstract voidexecute()Method to add the contents of the class method.intgetAccess()Accessor for the accessprotected ClassEnhancergetClassEnhancer()Convenience accessor for the ClassEnhancerStringgetDescriptor()Accessor for the descriptor of the method.static StringgetMethodAdditionMessage(String methodName, Object returnType, Object[] argTypes, String[] argNames)Convenience method to generate a message that a method has been added.StringgetName()Accessor for the method nameEnhancementNamergetNamer()inthashCode()Return hash code of this instance.voidinitialise()Default implementation of initialise, specifying the method based on the ClassMethod info.voidinitialise(ClassVisitor classVisitor)Method to initialise the class method.
 
- 
- 
- 
Field Detail- 
enhancerprotected ClassEnhancer enhancer The parent enhancer.
 - 
methodNameprotected String methodName Name of the method.
 - 
accessprotected int access Access flags for the method (public, protected etc).
 - 
returnTypeprotected Object returnType Return type for the method
 - 
argTypesprotected Object[] argTypes Types of the arguments.
 - 
argNamesprotected String[] argNames Names of the arguments.
 - 
exceptionsprotected String[] exceptions Exceptions that can be thrown.
 - 
visitorprotected MethodVisitor visitor Visitor for use in updating the method of the class (set in initialise).
 
- 
 - 
Constructor Detail- 
ClassMethodpublic ClassMethod(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames) Constructor.- Parameters:
- enhancer- ClassEnhancer
- name- Name of the method
- access- Access for the method (PUBLIC, PROTECTED etc)
- returnType- Return type
- argTypes- Argument type(s)
- argNames- Argument name(s)
 
 - 
ClassMethodpublic ClassMethod(ClassEnhancer enhancer, String name, int access, Object returnType, Object[] argTypes, String[] argNames, String[] exceptions) Constructor.- Parameters:
- enhancer- ClassEnhancer
- name- Name of the method
- access- Access for the method (PUBLIC, PROTECTED etc)
- returnType- Return type
- argTypes- Argument type(s)
- argNames- Argument name(s)
- exceptions- Exceptions that can be thrown
 
 
- 
 - 
Method Detail- 
initialisepublic void initialise() Default implementation of initialise, specifying the method based on the ClassMethod info.
 - 
initialisepublic void initialise(ClassVisitor classVisitor) Method to initialise the class method.- Parameters:
- classVisitor- Visitor for the class
 
 - 
getClassEnhancerprotected ClassEnhancer getClassEnhancer() Convenience accessor for the ClassEnhancer- Returns:
- ClassEnhancer
 
 - 
getDescriptorpublic String getDescriptor() Accessor for the descriptor of the method.- Returns:
- The descriptor
 
 - 
getNamerpublic EnhancementNamer getNamer() 
 - 
getNamepublic String getName() Accessor for the method name- Returns:
- Name of the method
 
 - 
getAccesspublic int getAccess() Accessor for the access- Returns:
- Access for the method
 
 - 
executepublic abstract void execute() Method to add the contents of the class method.
 - 
closepublic void close() Method to close the definition of the class method. This implementation simply logs a debug message to category ENHANCER.
 - 
hashCodepublic int hashCode() Return hash code of this instance.
 - 
equalspublic boolean equals(Object o) Indicates whether some other object is "equal to" this one.
 - 
getMethodAdditionMessagepublic static String getMethodAdditionMessage(String methodName, Object returnType, Object[] argTypes, String[] argNames) Convenience method to generate a message that a method has been added.- Parameters:
- methodName- Name of the method
- returnType- Return type of the method
- argTypes- arg types for the method
- argNames- arg names for the method
- Returns:
- The message
 
 
- 
 
-