use of jadx.api.JavaMethod in project jadx by skylot.
the class CodeLinesInfo method addClass.
public void addClass(JavaClass cls) {
map.put(cls.getDecompiledLine(), cls);
for (JavaClass innerCls : cls.getInnerClasses()) {
map.put(innerCls.getDecompiledLine(), innerCls);
addClass(innerCls);
}
for (JavaMethod mth : cls.getMethods()) {
map.put(mth.getDecompiledLine(), mth);
}
}
use of jadx.api.JavaMethod in project jadx by skylot.
the class JClass method update.
public synchronized void update() {
removeAllChildren();
if (!loaded) {
add(new TextNode(NLS.str("tree.loading")));
} else {
for (JavaClass javaClass : cls.getInnerClasses()) {
JClass innerCls = new JClass(javaClass, this);
add(innerCls);
innerCls.update();
}
for (JavaField f : cls.getFields()) {
add(new JField(f, this));
}
for (JavaMethod m : cls.getMethods()) {
add(new JMethod(m, this));
}
}
}
use of jadx.api.JavaMethod in project jadx by skylot.
the class QuarkReportPanel method resolveMethod.
public MutableTreeNode resolveMethod(String descr) {
try {
String[] parts = removeQuotes(descr).split(" ", 3);
String cls = Utils.cleanObjectName(parts[0].replace('$', '.'));
String mth = parts[1] + parts[2].replace(" ", "");
MainWindow mainWindow = getTabbedPane().getMainWindow();
JadxWrapper wrapper = mainWindow.getWrapper();
JavaClass javaClass = wrapper.searchJavaClassByRawName(cls);
if (javaClass == null) {
return new TextTreeNode(cls + "." + mth);
}
JavaMethod javaMethod = javaClass.searchMethodByShortId(mth);
if (javaMethod == null) {
return new TextTreeNode(javaClass.getFullName() + "." + mth);
}
return new MethodTreeNode(javaMethod);
} catch (Exception e) {
LOG.error("Failed to parse method descriptor string", e);
return new TextTreeNode(descr);
}
}
use of jadx.api.JavaMethod in project jadx by skylot.
the class CommentsIndex method getRefNode.
@Nullable
private JNode getRefNode(ICodeComment comment) {
IJavaNodeRef nodeRef = comment.getNodeRef();
JavaClass javaClass = wrapper.searchJavaClassByOrigClassName(nodeRef.getDeclaringClass());
if (javaClass == null) {
return null;
}
JNodeCache nodeCache = cacheObject.getNodeCache();
switch(nodeRef.getType()) {
case CLASS:
return nodeCache.makeFrom(javaClass);
case FIELD:
for (JavaField field : javaClass.getFields()) {
if (field.getFieldNode().getFieldInfo().getShortId().equals(nodeRef.getShortId())) {
return nodeCache.makeFrom(field);
}
}
break;
case METHOD:
for (JavaMethod mth : javaClass.getMethods()) {
if (mth.getMethodNode().getMethodInfo().getShortId().equals(nodeRef.getShortId())) {
return nodeCache.makeFrom(mth);
}
}
break;
}
return null;
}
use of jadx.api.JavaMethod in project jadx by skylot.
the class JNodeCache method convert.
private JNode convert(JavaNode node) {
if (node == null) {
return null;
}
if (node instanceof JavaClass) {
return convert(((JavaClass) node));
}
if (node instanceof JavaMethod) {
return new JMethod((JavaMethod) node, makeFrom(node.getDeclaringClass()));
}
if (node instanceof JavaField) {
return new JField((JavaField) node, makeFrom(node.getDeclaringClass()));
}
if (node instanceof JavaVariable) {
JavaVariable javaVar = (JavaVariable) node;
JMethod jMth = (JMethod) makeFrom(javaVar.getMth());
return new JVariable(jMth, javaVar);
}
throw new JadxRuntimeException("Unknown type for JavaNode: " + node.getClass());
}
Aggregations