Package org.objectweb.asm.test
Class ClassFile.CpInfo
- java.lang.Object
-
- org.objectweb.asm.test.ClassFile.CpInfo
-
- Direct Known Subclasses:
ClassFile.ConstantClassInfo,ClassFile.ConstantDoubleInfo,ClassFile.ConstantDynamicInfo,ClassFile.ConstantFieldRefInfo,ClassFile.ConstantFloatInfo,ClassFile.ConstantIntegerInfo,ClassFile.ConstantInterfaceMethodRefInfo,ClassFile.ConstantInvokeDynamicInfo,ClassFile.ConstantLongInfo,ClassFile.ConstantMethodHandleInfo,ClassFile.ConstantMethodRefInfo,ClassFile.ConstantMethodTypeInfo,ClassFile.ConstantModuleInfo,ClassFile.ConstantNameAndTypeInfo,ClassFile.ConstantPackageInfo,ClassFile.ConstantStringInfo,ClassFile.ConstantUtf8Info
- Enclosing class:
- ClassFile
private abstract static class ClassFile.CpInfo extends java.lang.ObjectAn abstract constant pool item.
-
-
Field Summary
Fields Modifier and Type Field Description private ClassFile.ClassContextclassContextThe context to use to get the referenced constant pool items.private java.lang.StringdumpThe dump of this item.
-
Constructor Summary
Constructors Constructor Description CpInfo(java.lang.String dump)Constructs a CpInfo for an item without references to other items.CpInfo(ClassFile.ClassContext classContext)Constructs a CpInfo for an item with references to other items.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) java.lang.Stringdump()Returns the dump of this item.(package private) <C extends ClassFile.CpInfo>
CgetCpInfo(int cpIndex, java.lang.Class<C> cpInfoType)Returns the constant pool item with the given index.(package private) intsize()Returns the number of entries used by this item in constant_pool.java.lang.StringtoString()
-
-
-
Field Detail
-
dump
private java.lang.String dump
The dump of this item.
-
classContext
private final ClassFile.ClassContext classContext
The context to use to get the referenced constant pool items.
-
-
Constructor Detail
-
CpInfo
CpInfo(java.lang.String dump)
Constructs a CpInfo for an item without references to other items.- Parameters:
dump- the dump of this item.
-
CpInfo
CpInfo(ClassFile.ClassContext classContext)
Constructs a CpInfo for an item with references to other items.- Parameters:
classContext- a context to lookup constant pool items from their index.
-
-
Method Detail
-
size
int size()
Returns the number of entries used by this item in constant_pool.- Returns:
- the number of entries used by this item in constant_pool.
-
getCpInfo
<C extends ClassFile.CpInfo> C getCpInfo(int cpIndex, java.lang.Class<C> cpInfoType)
Returns the constant pool item with the given index.- Type Parameters:
C- a CpInfo subclass.- Parameters:
cpIndex- a constant pool entry index.cpInfoType- the expected type of the constant pool entry.- Returns:
- the constant pool item with the given index.
-
dump
java.lang.String dump()
Returns the dump of this item.- Returns:
- the dump of this item.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-