blob: c6f574374430bb6a35c272f26dc5ce5448669621 [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="en">
<head>
<meta name="copyright" content="Copyright (c) IBM Corporation and others 2000, 2016. This page is made available under license. For full details see the LEGAL in the documentation book that contains this page." >
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta http-equiv="Content-Style-Type" content="text/css">
<title>New Java Annotation Wizard</title>
<link rel="stylesheet" href="../book.css" charset="ISO-8859-1" type="text/css">
<script language="JavaScript" src="PLUGINS_ROOT/org.eclipse.help/livehelp.js" type="text/javascript"> </script>
</head>
<body>
<h1>New Java Annotation Wizard</h1>
<p>The
<a class="command-link" href='javascript:executeCommand("org.eclipse.ui.newWizard(newWizardId=org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard)")'>
<img src="PLUGINS_ROOT/org.eclipse.help/command_link.png" alt="Opens the New Java Annotation Type wizard">
<b>New Java Annotation Type</b></a> wizard
helps you to create a new Java Annotation in a Java project.</p>
<table border="1" cellspacing="0" cellpadding="5" summary="Java Annotation options">
<caption>
Java Annotation Options<br>
</caption>
<tr>
<th>Option</th>
<th>Description</th>
<th>Default</th>
</tr>
<tr>
<td align="left" valign="top">Source folder</td>
<td align="left" valign="top">Enter a source folder for the new annotation. Either type a valid source folder path or click <span class="control">Browse</span> to select a
source folder via a dialog.</td>
<td align="left" valign="top">The source folder of the element that was selected when the wizard has been started.</td>
</tr>
<tr>
<td align="left" valign="top">Package</td>
<td align="left" valign="top">Enter a package to contain the new annotation. You can select either this option or the Enclosing Type option, below. Either type a valid
package name or click <span class="control">Browse</span> to select a package via a dialog.</td>
<td align="left" valign="top">The package of the element that was selected when the wizard has been started.
If a source folder was selected which contains exactly one package then that package is used.
If the source folder does not contain any package then the project name is used if it is a valid package name.
</td>
</tr>
<tr>
<td align="left" valign="top">Enclosing type</td>
<td align="left" valign="top">Select this option to choose a type in which to enclose the new annotation. You can select either this option or the Package option, above.
Either type a valid name in the field or click <span class="control">Browse</span> to select a type via a dialog.</td>
<td align="left" valign="top">The type or the primary type of the compilation unit that was selected when the wizard has been started or &lt;blank&gt;</td>
</tr>
<tr>
<td align="left" valign="top">Name</td>
<td align="left" valign="top">Type a name for the new annotation.</td>
<td align="left" valign="top">&lt;blank&gt;</td>
</tr>
<tr>
<td align="left" valign="top">Modifiers</td>
<td align="left" valign="top">
<p>Select one or more access modifiers for the new annotation.</p>
<ul>
<li>Either public, package, private, or protected (private and protected are only available if you specify an enclosing type)</li>
</ul>
</td>
<td align="left" valign="top">public</td>
</tr>
<tr>
<td align="left" valign="top">Add @Retention</td>
<td align="left" valign="top">When selected, the wizard adds a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Retention.html"><code>@Retention</code></a>
annotation with the selected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/RetentionPolicy.html"><code>RetentionPolicy</code></a>
to the new annotation.</td>
<td align="left" valign="top">Do not add the annotation</td>
</tr>
<tr>
<td align="left" valign="top">Add @Target</td>
<td align="left" valign="top">When selected, the wizard adds a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Target.html"><code>@Target</code></a>
annotation with the selected <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html"><code>ElementType</code></a>s
to the new annotation. The available <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/ElementType.html"><code>ElementType</code></a>s
depend on the source compliance level of the selected project.</td>
<td align="left" valign="top">Do not add the annotation</td>
</tr>
<tr>
<td align="left" valign="top">Add @Documented</td>
<td align="left" valign="top">When selected, the wizard adds a <a href="https://docs.oracle.com/javase/8/docs/api/java/lang/annotation/Documented.html"><code>@Documented</code></a>
annotation to the new annotation.</td>
<td align="left" valign="top">Do not add the annotation</td>
</tr>
<tr>
<td align="left" valign="top">Do you want to add comments?</td>
<td align="left" valign="top">When selected, the wizard adds comments to the new annotation where appropriate.</td>
<td align="left" valign="top">Do not add comments</td>
</tr>
</table>
<p>
<img src="../images/ngrelr.png" alt="Related reference" border="0" >
</p>
<p>
<a href="../reference/ref-menu-file.htm">File actions</a></p>
</body>
</html>