0
내가 특정 클래스에 javap -c Address.class > Address.txt
을 실행자바 클래스 상수 풀에서 상수 매핑 목록을 얻는 방법은 무엇입니까?
나는 정수 풀 내가 형태로 풀을 얻을 수있을 것입니다 방법
Compiled from "Address.java"
public class test.Address extends test.Entity {
public test.Address();
Code:
0: aload_0
1: invokespecial #1 // Method test/DefaultEntity."<init>":()V
4: aload_0
5: aconst_null
6: putfield #2 // Field io:Ljava/lang/String;
9: aload_0
10: aconst_null
11: putfield #3 // Field zip4:Ljava/lang/String;
14: aload_0
15: aconst_null
16: putfield #4 // Field zip:Ljava/lang/String;
19: aload_0
에 대한 지표로 #<NUMBER>
과 출력의 무리를 얻을 수 해시 맵? 즉 :
{1 "Method test/DefaultEntity."<init>":()"
2 "Field io:Ljava/lang/String;"}
상수 풀 '은 javap -c -verbose YourClass'의 출력의 상단에있다. –
프로그래밍 방식으로 가져 오는 방법이 있습니까? 나는 asm을보고 있지만 그 방법을 찾을 수 없었다. – zcaudate
[BCEL] (https://commons.apache.org/proper/commons-bcel/)을 사용하여 [Constant Pool] (http : // commons .class 파일] (http://docs.oracle.com/javase/specs/jvms/se7/)에서 ".apache.org/proper/commons-bcel/apidocs/org/apache/bcel/classfile/ConstantPool.html" html/jvms-4.html). –