1 21 package proguard.classfile.attribute; 22 23 import proguard.classfile.*; 24 import proguard.classfile.attribute.annotation.*; 25 import proguard.classfile.attribute.visitor.AttributeVisitor; 26 27 import java.io.*; 28 29 36 public abstract class Attribute implements VisitorAccepter 37 { 38 public int u2attributeNameIndex; 39 42 45 public Object visitorInfo; 46 47 48 51 public String getAttributeName(Clazz clazz) 52 { 53 return clazz.getString(u2attributeNameIndex); 54 } 55 56 57 59 62 public void accept(Clazz clazz, AttributeVisitor attributeVisitor) 63 { 64 throw new UnsupportedOperationException ("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 65 } 66 67 70 public void accept(Clazz clazz, Field field, AttributeVisitor attributeVisitor) 71 { 72 if (field == null) 74 { 75 accept(clazz, attributeVisitor); 76 } 77 else 78 { 79 throw new UnsupportedOperationException ("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 80 } 81 } 82 83 86 public void accept(Clazz clazz, Method method, AttributeVisitor attributeVisitor) 87 { 88 if (method == null) 90 { 91 accept(clazz, (Field)null, attributeVisitor); 92 } 93 else 94 { 95 throw new UnsupportedOperationException ("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 96 } 97 } 98 99 102 public void accept(Clazz clazz, Method method, CodeAttribute codeAttribute, AttributeVisitor attributeVisitor) 103 { 104 if (codeAttribute == null) 106 { 107 accept(clazz, method, attributeVisitor); 108 } 109 else 110 { 111 throw new UnsupportedOperationException ("Method must be overridden in ["+this.getClass().getName()+"] if ever called"); 112 } 113 } 114 115 116 118 public Object getVisitorInfo() 119 { 120 return visitorInfo; 121 } 122 123 public void setVisitorInfo(Object visitorInfo) 124 { 125 this.visitorInfo = visitorInfo; 126 } 127 } 128 | Popular Tags |