Add field references, only for getstatic currently
This commit is contained in:
@@ -17,8 +17,9 @@ public class Class extends PoolEntry
|
||||
index = is.readUnsignedShort();
|
||||
}
|
||||
|
||||
public int getIndex()
|
||||
public java.lang.String getName()
|
||||
{
|
||||
return index;
|
||||
UTF8 u = (UTF8) this.getPool().getEntry(index);
|
||||
return u.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,14 @@ public class Field extends PoolEntry
|
||||
classIndex = is.readUnsignedShort();
|
||||
nameAndTypeIndex = is.readUnsignedShort();
|
||||
}
|
||||
|
||||
public Class getClassEntry()
|
||||
{
|
||||
return (Class) this.getPool().getEntry(classIndex);
|
||||
}
|
||||
|
||||
public NameAndType getNameAndType()
|
||||
{
|
||||
return (NameAndType) this.getPool().getEntry(nameAndTypeIndex);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,4 +19,16 @@ public class NameAndType extends PoolEntry
|
||||
nameIndex = is.readUnsignedShort();
|
||||
descriptorIndex = is.readUnsignedShort();
|
||||
}
|
||||
|
||||
public java.lang.String getName()
|
||||
{
|
||||
UTF8 u = (UTF8) this.getPool().getEntry(nameIndex);
|
||||
return u.getValue();
|
||||
}
|
||||
|
||||
public java.lang.String getDescriptor()
|
||||
{
|
||||
UTF8 u = (UTF8) this.getPool().getEntry(descriptorIndex);
|
||||
return u.getValue();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ public abstract class PoolEntry
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public ConstantPool getPool()
|
||||
{
|
||||
return pool;
|
||||
}
|
||||
|
||||
public int getSlots()
|
||||
{
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user