Package org.jibx.binding.classes
Class BindingMethod
- java.lang.Object
-
- org.jibx.binding.classes.BindingMethod
-
- Direct Known Subclasses:
ExistingMethod
,MethodBuilder
public abstract class BindingMethod extends Object
Binding method information. Tracks a method used by the binding code, supplying hash code and equality checking based on the method signature and actual byte code of the method, ignoring the method name. This allows comparisons between methods generated by different bindings, and between generated and existing methods.- Version:
- 1.0
- Author:
- Dennis M. Sosnoski
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
BindingMethod(ClassFile cf)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static int
computeMethodHash(org.apache.bcel.classfile.Method method)
Computes the hash code for a method.boolean
equals(Object obj)
Check if objects are equal.abstract int
getAccessFlags()
Get access flags.ClassFile
getClassFile()
Get class file containing method.abstract ClassItem
getItem()
Get the method item.abstract org.apache.bcel.classfile.Method
getMethod()
Get the actual method.abstract String
getName()
Get name of method.abstract String
getSignature()
Get signature.abstract int
hashCode()
Get hash code.void
makeAccessible(ClassFile src)
Make accessible method.abstract void
setAccessFlags(int flags)
Set access flags.
-
-
-
Constructor Detail
-
BindingMethod
protected BindingMethod(ClassFile cf)
Constructor.- Parameters:
cf
- owning class file information
-
-
Method Detail
-
getClassFile
public ClassFile getClassFile()
Get class file containing method.- Returns:
- class file owning this method
-
getName
public abstract String getName()
Get name of method. This abstract method must be implemented by every subclass.- Returns:
- method name
-
getSignature
public abstract String getSignature()
Get signature. This abstract method must be implemented by every subclass.- Returns:
- signature for method
-
getAccessFlags
public abstract int getAccessFlags()
Get access flags. This abstract method must be implemented by every subclass.- Returns:
- flags for access type of method
-
setAccessFlags
public abstract void setAccessFlags(int flags)
Set access flags. This abstract method must be implemented by every subclass.- Parameters:
flags
- access type to be set
-
getMethod
public abstract org.apache.bcel.classfile.Method getMethod()
Get the actual method.- Returns:
- method information
-
getItem
public abstract ClassItem getItem()
Get the method item.- Returns:
- method item information
-
makeAccessible
public void makeAccessible(ClassFile src)
Make accessible method. Check if this method is accessible from another class, and if not decreases the access restrictions to make it accessible.- Parameters:
src
- class file for required access
-
computeMethodHash
public static int computeMethodHash(org.apache.bcel.classfile.Method method)
Computes the hash code for a method. The hash code is based on the method signature, the exceptions thrown, and the actual byte code (including the exception handlers).- Returns:
- computed hash code for method
-
hashCode
public abstract int hashCode()
Get hash code. This abstract method must be implemented by every subclass, using the same algorithm in each case. See one of the existing subclasses for details.
-
-