作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
如何确定编译单元是接口(interface)、类还是枚举?根据上图,它似乎不包含存储 AST 信息的字段。我在 DOCUMENTATION 中找不到任何内容
最佳答案
ICompilationUnit.findPrimaryType()
为您提供编译单元中主类的 IType
(一个编译单元中可以有多个类)。
IType.isClass()
、IType.isEnum()
、IType.isInterface()
方法告诉您有关类型的信息。
关于java - Eclipse AST Java 模型 : Where in ICompilationUnit stored whether it is class, 接口(interface)或枚举?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26653891/
我是一名优秀的程序员,十分优秀!