blob: 98223dbd90b8034818772ce4e00fe49e4ce3dd90 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="copyright" content="Copyright (c) 2005-2007 BEA Systems, Inc. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html" >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>
Annotation Processing Preferences
</title>
</head>
<body>
<h1>
Annotation Processing
</h1>
<p>Annotation processors are utility programs that can generate additional Java code or other files,
and produce problem markers,
based on Java 5 (JSR-175) annotations. Processors can be based on either the
<a href="http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/overview-summary.html">Java 5 Mirror APIs</a> or the
<a href="http://java.sun.com/javase/6/docs/api/javax/annotation/processing/package-summary.html">Java 6
annotation processing APIs</a>. The Annotation Processing preference pane permits configuration
of preferences that apply to all processors in a project or workspace. The <a href="ref-apt-factoryPath.htm">
Factory Path preference pane</a> specifies which processors are enabled and permits configuration of
individual processors.</p>
<h2>
Enable annotation processing
</h2>
<p>Annotation processing is turned off by default, and must be turned on by checking this checkbox
for each project that needs it. It is only necessary to enable annotation processing in a project
in order to have annotation processors operate on that project's code. The mere presence of
annotations in code does not mean that annotation processing is required; for example, the
<code>@Deprecated</code> and <code>@Override</code> annotations do not typically require processing.</p>
<h2>
Enable processing in editor
</h2>
<p>When this option is enabled, processors will run whenever changes are made in the Java editor,
as well as whenever the project is built. Enabling processors to run in the editor allows them to
generate contribute errors and warnings as you type. For instance, processors can red-squiggle
a bad annotation value to indicate a semantic problem that the compiler alone would not be able to discover.
However, some annotation processors are slow enough that running them in the editor interferes with
the usability of the editor. In this situation, disabling this option can improve performance of
the editor. Processors will still run whenever the project is built. This option does not apply to
Java 6 annotation processors, which Eclipse can (for now) only run during a build.</p>
<h2>
Generated source directory
</h2>
<p>Files will be generated on disk relative to the specified directory. By default this directory
is named &quot;.apt_generated&quot;, which since it starts with a '.' causes it to be filtered out
of the Package Explorer view.
Generated files have the &quot;derived&quot; bit set; when a project is cleaned, all derived files under the
generated source directory will be removed. It is recommended to only
use this directory for files generated by processors; do not place any manually created files under
this directory, and do not use a pre-existing directory as the generated source directory.</p>
<h2>
Processor options
</h2>
<p>Options entered here will be available via the AnnotationProcessorEnvironment interface (for Java
5 processors) or the ProcessingEnvironment interface (for Java 6 processors).
Certain options are automatically provided to Java 5 processors; entering them in this dialog
will have no effect, since the automatically provided values will override any values set here.
The automatic options are described <a href="ref-apt-automaticProcessorOptions.htm">here</a>. More
information about processor options is in the topic on <a href="ref-apt-processorOptionsInput.htm">the
Processor Options input dialog</a>.</p>
</body>
</html>