1 28 29 package org.jibx.binding.classes; 30 31 import org.apache.bcel.classfile.Method; 32 import org.jibx.runtime.JiBXException; 33 34 42 43 public class ExistingMethod extends BindingMethod 44 { 45 46 private ClassItem m_item; 47 48 49 private Method m_method; 50 51 52 private int m_hashCode; 53 54 55 private boolean m_used; 56 57 64 65 public ExistingMethod(Method method, ClassItem item, ClassFile file) { 66 super(file); 67 m_item = item; 68 m_method = method; 69 m_hashCode = computeMethodHash(method); 70 } 73 74 79 80 public String getName() { 81 return m_item.getName(); 82 } 83 84 89 90 public String getSignature() { 91 return m_item.getSignature(); 92 } 93 94 99 100 public int getAccessFlags() { 101 return m_item.getAccessFlags(); 102 } 103 104 109 110 public void setAccessFlags(int flags) { 111 m_item.setAccessFlags(flags); 112 } 113 114 119 120 public boolean isUsed() { 121 return m_used; 122 } 123 124 127 128 public void setUsed() { 129 m_used = true; 130 } 131 132 137 138 public Method getMethod() { 139 return m_method; 140 } 141 142 147 148 public ClassItem getItem() { 149 return m_item; 150 } 151 152 157 158 public void delete() throws JiBXException { 159 getClassFile().removeMethod(m_method); 160 } 161 162 167 168 public int hashCode() { 169 return m_hashCode; 170 } 171 } 172 | Popular Tags |