Java Model in JDT

Each Java project is internally represented in Eclipse as a Java model. The Eclipse Java model is a light-weight and fault tolerant representation of the Java project.

It does not contain as many information as the Abstract Syntax Tree (AST) but is fast to create. For example the Outline view is using the Java model for its representation; this way the information in the Outline view can quickly get updated.

The Java model is defined in the org.eclipse.jdt.core plug-in. JDT Core (org.eclipse.jdt.core) is the plug-in that defines the core Java elements and API. You should always list this plug-in as a prerequisite when you are developing Java specific features.

JDT Core packages give you access to the Java model objects and headless Java IDE infrastructure.  The JDT Core packages include:

org.eclipse.jdt.core - defines the classes that describe the Java model.
org.eclipse.jdt.core.compiler - defines an API for the compiler infrastructure.
org.eclipse.jdt.core.dom - supports Abstract Syntax Trees (AST) that can be used for examining the structure of a compilation unit down to the statement level.
org.eclipse.jdt.core.dom.rewrite - supports rewriting of Abstract Syntax Trees (AST) that can be used for manipulating the structure of a compilation unit down to the statement level.
org.eclipse.jdt.core.eval - supports the evaluation of code snippets in a scrapbook or inside the debugger.
org.eclipse.jdt.core.formatter - supports the formatting of compilation units, types, statements, expressions, etc.
org.eclipse.jdt.core.jdom - supports a Java Document Object Model (DOM) that can be used for walking the structure of a Java compilation unit.
org.eclipse.jdt.core.search - supports searching the workspace's Java model for Java elements that match a particular description.  

org.eclipse.jdt.core.util - provides utility classes for manipulating .class files and Java model elements.                                                                                                                                            

Project Element Java Model element Description
Java project IJavaProject The Java project which contains all other objects.
src folder / bin folder / or external library IPackageFragmentRoot Hold source or binary files, can be a folder or a library (zip / jar file)
Each package IPackageFragment Each package is below the IPackageFragmentRoot, sub-packages are not leaves of the package, they are listed directed under IPackageFragmentRoot
Java Source File ICompilationUnit The Source file is always below the package node
Types / Fields / Methods IType / IField / IMethod Types, fields and methods

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值