1 23 24 25 package com.sun.enterprise.tools.verifier.apiscan.classfile; 26 27 30 public class MethodRef { 31 private String owningClassNameInternal; 33 private String owningClassName; 35 private String name; 37 private String descriptor; 39 public static final String CLINIT_NAME = "<clinit>"; 41 public static final String CLINIT_DESC = "()V"; 43 public MethodRef(String owningClassNameInternal, String name, String descriptor) { 44 this.owningClassNameInternal = owningClassNameInternal; 45 this.owningClassName = Util.convertToExternalClassName(owningClassNameInternal); 46 this.name = name; 47 this.descriptor = descriptor; 48 } 49 50 public String getDescriptor() { 51 return descriptor; 52 } 53 54 public String getOwningClassNameInternal() { 55 return owningClassNameInternal; 56 } 57 58 public String getOwningClassName(){ 59 return owningClassName; 60 } 61 62 public String getName() { 63 return name; 64 } 65 66 public boolean equals(Object o) { 67 if (this == o) return true; 68 if (!(o instanceof MethodRef)) return false; 69 final MethodRef methodRef = (MethodRef) o; 70 if (descriptor != null ? 71 !descriptor.equals(methodRef.descriptor) : 72 methodRef.descriptor != null) 73 return false; 74 if (name != null ? 75 !name.equals(methodRef.name) : methodRef.name != null) 76 return false; 77 if (owningClassNameInternal != null ? 78 !owningClassNameInternal.equals(methodRef.owningClassNameInternal) : 79 methodRef.owningClassNameInternal != null) 80 return false; 81 return true; 82 } 83 84 public int hashCode() { 85 int result; 86 result = (owningClassNameInternal != null ? owningClassNameInternal.hashCode() : 0); 87 result = 29 * result + (name != null ? name.hashCode() : 0); 88 result = 29 * result + 89 (descriptor != null ? descriptor.hashCode() : 0); 90 return result; 91 } 92 93 @Override public String toString() { 94 return owningClassNameInternal + "." + name + descriptor; } 96 } 97 | Popular Tags |