Package org.jibx.binding.classes
Class BindingMethod
java.lang.Object
org.jibx.binding.classes.BindingMethod
- Direct Known Subclasses:
ExistingMethod
,MethodBuilder
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
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
computeMethodHash
(Method method) Computes the hash code for a method.boolean
Check if objects are equal.abstract int
Get access flags.Get class file containing method.abstract ClassItem
getItem()
Get the method item.abstract Method
Get the actual method.abstract String
getName()
Get name of method.abstract String
Get signature.abstract int
hashCode()
Get hash code.void
makeAccessible
(ClassFile src) Make accessible method.abstract void
setAccessFlags
(int flags) Set access flags.
-
Field Details
-
m_classFile
Owning class file information.
-
-
Constructor Details
-
BindingMethod
Constructor.- Parameters:
cf
- owning class file information
-
-
Method Details
-
getClassFile
Get class file containing method.- Returns:
- class file owning this method
-
getName
Get name of method. This abstract method must be implemented by every subclass.- Returns:
- method name
-
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 Method getMethod()Get the actual method.- Returns:
- method information
-
getItem
Get the method item.- Returns:
- method item information
-
makeAccessible
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(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. -
equals
Check if objects are equal. Compares first based on hash code, then on the actual byte code sequence.
-