Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 

Eclipse Web Tools Guide
Previous Page Home Next Page

Java EE 5 support for annotations

The goal of Java™ EE 5 platform development is to minimize the number of artifacts that you have to create and maintain, thereby simplifying the development process. Java EE 5 supports the injection of annotations into your source code, so that you can embed resources, dependencies, services, and life-cycle notifications in your source code, without having to maintain these artifacts elsewhere.

An annotation is a modifier or Metadata tag that provides additional data to Java classes, interfaces, constructors, methods, fields, parameters, and local variables. Annotations replace boilerplate code, common code that is required by certain applications. For example, an annotation can replace the paired interface and implementation required for a Web service. Annotations can also replace additional files that programs require, which are maintained separately. By using an annotation, this separate file is no longer required. For example, annotations can replace the need for a separately maintained deployment descriptor for JavaBeans™.

Annotations
  • Replace descriptors for most purposes
  • Remove the need for marker interfaces (like java.rmi.Remote)
  • Allow application settings to be visible in the component they affect
Java EE 5 provides annotations for the following tasks, among others:
  • Developing Enterprise JavaBean applications
  • Defining and using Web services
  • Mapping Java technology classes to XML
  • Mapping Java technology classes to databases
  • Mapping methods to operations
  • Specifying external dependencies
  • Specirying deployment information, including security attributes
Java EE 5 defines a number of annotations that can be injected into your source code. To declare an annotation, you simply precede the keyword with an "at" sign (@).
package com.ibm.counter;

import javax.ejb.Stateless;

@Stateless

public class CounterBean {

}

For more information about the categories of annotations that Java EE 5 supports, see Types of annotations.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire