1 25 26 package org.netbeans.modules.classfile; 27 28 33 public final class CPUTF8Info extends CPName { 34 String name; 35 byte[] utf; 36 37 CPUTF8Info(ConstantPool pool, String name) { 38 super(pool); 39 this.name = name; 40 } 41 42 CPUTF8Info(ConstantPool pool, byte[] utf) { 43 super(pool); 44 this.utf = utf; 45 } 46 47 public final String getName() { 48 if (name == null) { 49 name = ConstantPoolReader.readUTF(utf, utf.length); 50 utf = null; 51 } 52 return name; 53 } 54 55 public final Object getValue() { 56 return getName(); 57 } 58 59 public final int getTag() { 60 return ConstantPool.CONSTANT_Utf8; 61 } 62 63 public String toString() { 64 return getClass().getName() + ": name=" + getName(); } 66 } 67 | Popular Tags |