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 byte
ConstantCONSTANT_CLASS=7
static final byte
ConstantCONSTANT_DOUBLE=6
static final byte
ConstantCONSTANT_FIELDREF=9
static final byte
ConstantCONSTANT_FLOAT=4
static final byte
ConstantCONSTANT_INTEGER=3
static final byte
ConstantCONSTANT_INTERFACEMETHODREF=11
static final byte
ConstantCONSTANT_INVOKE=17
static final byte
ConstantCONSTANT_INVOKE_DYNAMIC=18
static final byte
ConstantCONSTANT_LONG=5
static final byte
ConstantCONSTANT_METHOD_TYPE=16
static final byte
ConstantCONSTANT_METHODHANDLE=15
static final byte
ConstantCONSTANT_METHODREF=10
static final byte
ConstantCONSTANT_MODULE=19
static final byte
ConstantCONSTANT_NAME_AND_TYPE=12
static final byte
ConstantCONSTANT_PACKAGE=20
static final byte
ConstantCONSTANT_STRING=8
static final byte
ConstantCONSTANT_UTF8=1
static final int
ConstantHEAD=0xcafebabe
private static final int
private static final int
private static final int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addClassToResult
(Set<String> result, String className) private static void
consumeDouble
(ByteBuffer buf) private static void
consumeDynamic
(ByteBuffer buf) private static void
consumeFloat
(ByteBuffer buf) private static void
consumeInt
(ByteBuffer buf) private static void
private static void
consumeLong
(ByteBuffer buf) private static void
private static void
private static void
consumeModule
(ByteBuffer buf) private static void
consumePackage
(ByteBuffer buf) private static void
private static void
consumeString
(ByteBuffer buf) private static String
decodeString
(ByteBuffer buf) getConstantPoolClassReferences
(byte[] b) private static boolean
isImportableClass
(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
-