API Tools in Eclipse: a Brief introduction

Source: Internet
Author: User
Tags naming convention

Learn how to use the APIs for Eclipse management applications

Creating application Public Interface (APIs), especially managing the various versions of the APIs, is difficult. Learn how to use Eclipse's PDE API Tools to simplify this process and seamlessly integrate it into day-to-day development. Note that this article is intended specifically for Eclipse V3.4:ganymede.

Before detailing the application public Interface (API) tools within the Eclipse Plug-in Development Environment (PDE), let's talk about the implications of the APIs in eclipse.

What is an API?

Have you ever received the following warnings or errors in Eclipse and want to know what they mean?

Figure 1. Block access

Internal Package

Depending on the naming convention, the ability to actually make a package API in a plug-in depends on whether the package is exported to MANIFEST. MF file. If it is, it is considered an API. To create content that is not an API, you can mark the exported package with the X-internal:=true property. This will indicate that the package exported by Eclipse is available, but is considered an internal package.

The reason for the warning is most likely that you are accessing code that cannot be publicly accessed using some form of API. Typically, API elements are well documented and have some sort of specification. Non-API elements, on the other hand, are treated as internal implementation details and are often not accompanied by publishing documents. Eclipse in the previous illustration informs you that you have accessed these internal elements. Eclipse politely warns you that you are accessing code that may change and is not officially supported. So, exactly what is the API?

Because Eclipse is based on the Java™ programming language, there are four of API elements. Let's look at it one by one.

The API package contains at least one package of API classes or API interfaces.

Table 1. Package naming conventions in the Eclipse platform

Naming conventions Sample Package
org.eclipse.xyz.* Org.eclipse.ui, Org.eclipse.swt.widgets
Org.eclipse.xyz.internal.* Org.eclipse.comp are.internal, Org.eclipse.ui.internal
Org.eclipse.xyz.internal.provisional.* Org. eclipse.equinox.internal.provisional.p2.engine
A public class or interface in an API class or interface API package, or a public or protected class or interface member declared or inherited in one of the other API classes or interfaces. The public or protected method or constructor declared or inherited by an API method in an API class or interface. The public or protected field that the API field declares or inherits in the API class or interface.

Now that we know all kinds of API elements, let's talk about API Tools and how it can manage these API elements for you.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.