Eclipse,JDT:在类路径上查找一个知道其完全限定名称的文件
给定名称 ch/mollusca/sample/snippet.xml
,当该文件作为源文件或位于项目类路径中时,是否有一种简单的方法可以在 JDT 代码中获取该文件在 JAR 中?
该文件也可能位于另一个项目中,该项目由该项目引用,我试图在该项目中获取名称后面的实际文件。
这是特定于 Java 项目的,因此如果有帮助的话,可以获取 IJavaProject。
Given the name ch/mollusca/sample/snippet.xml
, is there an easy way to get a hold of this file in JDT code, when it is located in the projects classpath either as a source file or inside a JAR?
The file may also be inside another project, that is referenced by the one, where I'm trying to get a hold of the actual file behind the name.
This is specific to Java projects, so it's possible to get a hold of the IJavaProject if that helps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这可能不是您想要的答案,但这是我能做的最好的答案(由于您的问题已经有 2 天的时间,我可能会向您抛出这个):
Eclipse 角文章:抽象语法树
Eclipse JDT - 抽象语法树 (AST) 和 Java 模型 - 教程
这两篇精彩的文章将为您指明正确的方向。
This is probably not the answer you want, but it's the best I can do (and since your question already has 2 days, I might has well throw you this):
Eclipse Corner Articles: Abstract Syntax Tree
Eclipse JDT - Abstract Syntax Tree (AST) and the Java Model - Tutorial
These two great articles will point you to the right direction.
这个怎么样:
How about this: