jadx.plugins.input.java.data.attributes.debuginfo.LineNumberTableAttr Maven / Gradle / Ivy
The newest version!
package jadx.plugins.input.java.data.attributes.debuginfo;
import java.util.HashMap;
import java.util.Map;
import jadx.plugins.input.java.data.attributes.IJavaAttribute;
import jadx.plugins.input.java.data.attributes.IJavaAttributeReader;
public class LineNumberTableAttr implements IJavaAttribute {
private final Map lineMap;
public LineNumberTableAttr(Map sourceLineMap) {
this.lineMap = sourceLineMap;
}
public Map getLineMap() {
return lineMap;
}
public static IJavaAttributeReader reader() {
return (clsData, reader) -> {
int len = reader.readU2();
Map map = new HashMap<>(len);
for (int i = 0; i < len; i++) {
int offset = reader.readU2();
int line = reader.readU2();
map.put(offset, line);
}
return new LineNumberTableAttr(map);
};
}
}