Class ConstantPoolParser
java.lang.Object
org.apache.maven.shared.dependency.analyzer.asm.ConstantPoolParser
A small parser to read the constant pool directly, in case it contains references
ASM does not support.
Adapted from http://stackoverflow.com/a/32278587/23691
Constant pool types:
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final byteConstantCONSTANT_CLASS=7static final byteConstantCONSTANT_DOUBLE=6static final byteConstantCONSTANT_FIELDREF=9static final byteConstantCONSTANT_FLOAT=4static final byteConstantCONSTANT_INTEGER=3static final byteConstantCONSTANT_INTERFACEMETHODREF=11static final byteConstantCONSTANT_INVOKE=17static final byteConstantCONSTANT_INVOKE_DYNAMIC=18static final byteConstantCONSTANT_LONG=5static final byteConstantCONSTANT_METHOD_TYPE=16static final byteConstantCONSTANT_METHODHANDLE=15static final byteConstantCONSTANT_METHODREF=10static final byteConstantCONSTANT_MODULE=19static final byteConstantCONSTANT_NAME_AND_TYPE=12static final byteConstantCONSTANT_PACKAGE=20static final byteConstantCONSTANT_STRING=8static final byteConstantCONSTANT_UTF8=1static final intConstantHEAD=0xcafebabeprivate static final intprivate static final intprivate static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddClassToResult(Set<String> result, String className) private static voidconsumeDouble(ByteBuffer buf) private static voidconsumeDynamic(ByteBuffer buf) private static voidconsumeFloat(ByteBuffer buf) private static voidconsumeInt(ByteBuffer buf) private static voidprivate static voidconsumeLong(ByteBuffer buf) private static voidprivate static voidprivate static voidconsumeModule(ByteBuffer buf) private static voidconsumePackage(ByteBuffer buf) private static voidprivate static voidconsumeString(ByteBuffer buf) private static StringdecodeString(ByteBuffer buf) getConstantPoolClassReferences(byte[] b) private static booleanisImportableClass(String className)
-
Field Details
-
HEAD
public static final int HEADConstantHEAD=0xcafebabe- See Also:
-
CONSTANT_UTF8
public static final byte CONSTANT_UTF8ConstantCONSTANT_UTF8=1- See Also:
-
CONSTANT_INTEGER
public static final byte CONSTANT_INTEGERConstantCONSTANT_INTEGER=3- See Also:
-
CONSTANT_FLOAT
public static final byte CONSTANT_FLOATConstantCONSTANT_FLOAT=4- See Also:
-
CONSTANT_LONG
public static final byte CONSTANT_LONGConstantCONSTANT_LONG=5- See Also:
-
CONSTANT_DOUBLE
public static final byte CONSTANT_DOUBLEConstantCONSTANT_DOUBLE=6- See Also:
-
CONSTANT_CLASS
public static final byte CONSTANT_CLASSConstantCONSTANT_CLASS=7- See Also:
-
CONSTANT_STRING
public static final byte CONSTANT_STRINGConstantCONSTANT_STRING=8- See Also:
-
CONSTANT_FIELDREF
public static final byte CONSTANT_FIELDREFConstantCONSTANT_FIELDREF=9- See Also:
-
CONSTANT_METHODREF
public static final byte CONSTANT_METHODREFConstantCONSTANT_METHODREF=10- See Also:
-
CONSTANT_INTERFACEMETHODREF
public static final byte CONSTANT_INTERFACEMETHODREFConstantCONSTANT_INTERFACEMETHODREF=11- See Also:
-
CONSTANT_NAME_AND_TYPE
public static final byte CONSTANT_NAME_AND_TYPEConstantCONSTANT_NAME_AND_TYPE=12- See Also:
-
CONSTANT_METHODHANDLE
public static final byte CONSTANT_METHODHANDLEConstantCONSTANT_METHODHANDLE=15- See Also:
-
CONSTANT_METHOD_TYPE
public static final byte CONSTANT_METHOD_TYPEConstantCONSTANT_METHOD_TYPE=16- See Also:
-
CONSTANT_INVOKE
public static final byte CONSTANT_INVOKEConstantCONSTANT_INVOKE=17- See Also:
-
CONSTANT_INVOKE_DYNAMIC
public static final byte CONSTANT_INVOKE_DYNAMICConstantCONSTANT_INVOKE_DYNAMIC=18- See Also:
-
CONSTANT_MODULE
public static final byte CONSTANT_MODULEConstantCONSTANT_MODULE=19- See Also:
-
CONSTANT_PACKAGE
public static final byte CONSTANT_PACKAGEConstantCONSTANT_PACKAGE=20- See Also:
-
OXF0
private static final int OXF0- See Also:
-
OXE0
private static final int OXE0- See Also:
-
OX3F
private static final int OX3F- See Also:
-
-
Constructor Details
-
ConstantPoolParser
public ConstantPoolParser()
-
-
Method Details
-
getConstantPoolClassReferences
-
parseConstantPoolClassReferences
-
addClassToResult
-
decodeString
-
isImportableClass
-
consumeMethodType
-
consumeReference
-
consumeInt
-
consumeFloat
-
consumeDouble
-
consumeLong
-
consumeString
-
consumeMethodHandle
-
consumeDynamic
-
consumeInvokeDynamic
-
consumeModule
-
consumePackage
-