1 11 package org.eclipse.jdt.internal.core.util; 12 13 import org.eclipse.jdt.core.util.ClassFormatException; 14 import org.eclipse.jdt.core.util.IConstantPool; 15 import org.eclipse.jdt.core.util.IConstantPoolEntry; 16 import org.eclipse.jdt.core.util.IConstantValueAttribute; 17 18 21 public class ConstantValueAttribute 22 extends ClassFileAttribute 23 implements IConstantValueAttribute { 24 25 private int constantValueIndex; 26 private IConstantPoolEntry constantPoolEntry; 27 28 29 ConstantValueAttribute(byte[] classFileBytes, IConstantPool constantPool, int offset) throws ClassFormatException { 30 super(classFileBytes, constantPool, offset); 31 this.constantValueIndex = u2At(classFileBytes, 6, offset); 32 this.constantPoolEntry = constantPool.decodeEntry(this.constantValueIndex); 33 } 34 37 public IConstantPoolEntry getConstantValue() { 38 return this.constantPoolEntry; 39 } 40 41 44 public int getConstantValueIndex() { 45 return this.constantValueIndex; 46 } 47 } 48 | Popular Tags |