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 intcomputeMethodHash(Method method) Computes the hash code for a method.booleanCheck if objects are equal.abstract intGet access flags.Get class file containing method.abstract ClassItemgetItem()Get the method item.abstract MethodGet the actual method.abstract StringgetName()Get name of method.abstract StringGet signature.abstract inthashCode()Get hash code.voidmakeAccessible(ClassFile src) Make accessible method.abstract voidsetAccessFlags(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.
-