简体   繁体   English

field.get和对象实例名称

[英]field.get and object instance name

Disclosure: I am new to Java 披露:我是Java新手

I need to access a field in an object from a third party package. 我需要从第三方程序包访问对象中的字段。 I have found the object in a heap dump, but I am unable to locate a name for the object that can be externally referenced. 我在堆转储中找到了该对象,但是无法找到可以在外部引用的对象的名称。 If I do a OQL query in the heap dump for "select x from classname x", the result I get is classname#1. 如果我在堆转储中对“从类名x中选择x”进行OQL查询,则得到的结果是类名#1。 Unfortunately field.get does not like classname#1 as a argument, netbeans gives me a illegal character \\35 error. 不幸的是field.get不喜欢classname#1作为参数,netbeans给我一个非法字符\\ 35错误。

Any tips on how to get an object name for this instance that field.get will accept? 关于如何获取field.get可以接受的该实例的对象名称的任何提示?

edit: this is an extension app for a 3rd party program. 编辑:这是第三方程序的扩展应用程序。 the app needs to pull info from the 3rd party program while it is running. 该应用需要在运行时从第三方程序中提取信息。

edit2: here is a screenshot of the heapdump, I need to know how to get an object name for what the green arrow is pointing to. edit2: 是heapdump的屏幕截图,我需要知道如何获取绿色箭头指向的对象名称。

Without knowing exactly what you're trying to do, I'm guessing that a Java IDE such as Eclipse will better provide you with what you're looking for than OQL. 在不确切知道要做什么的情况下,我猜想像Eclipse这样的Java IDE会比OQL更好地为您提供所需的内容。

Is your need limited to working within OQL - or are you just trying to use OQL to find the details for use within future development? 您的需要仅限于在OQL中工作吗?还是只是尝试使用OQL查找要在将来的开发中使用的详细信息?

If the later, if you're trying to reference classes / methods / variables in the other code, I'm assuming you have a JAR or *.class files of the other code you're trying to interface with. 如果是更高版本,如果您尝试在其他代码中引用类/方法/变量,则假定您具有要与之交互的其他代码的JAR或* .class文件。 If you add this other code (even in it's bytecode format, without the original sources) as references to your project, most IDEs (including Eclipse) will show you a nice outline of all of the available classes, methods, and instance variables - assuming there was no obfuscation used. 如果将其他代码(即使是字节码格式,也没有原始源)添加为对项目的引用,则大多数IDE(包括Eclipse)都会为您提供所有可用类,方法和实例变量的清晰概述-假设没有使用混淆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM