欢迎访问悦橙教程(wld5.com),关注java教程。悦橙教程  java问答|  每日更新
页面导航 : > > 文章正文

Java Model in JDT,javamodelinjdt

来源: javaer 分享于  点击 43390 次 点评:6

Java Model in JDT,javamodelinjdt


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

相关文章

    暂无相关文章
相关栏目:

用户点评