Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 223427 Details for
Bug 213636
JDT APT web page is horribly horribly out of date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
APT site is migrated to Phoenix
APT-site-is-migrated-from-frames-to-Phoenix-Bug-2136.patch (text/plain), 34.76 KB, created by
Denys Digtiar
on 2012-11-10 01:30:17 EST
(
hide
)
Description:
APT site is migrated to Phoenix
Filename:
MIME Type:
Creator:
Denys Digtiar
Created:
2012-11-10 01:30:17 EST
Size:
34.76 KB
patch
obsolete
>diff --git a/apt/faq.html b/apt/faq.html >index 5f5aa94..b1ca20e 100644 >--- a/apt/faq.html >+++ b/apt/faq.html >@@ -1,102 +1,9 @@ >-<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> >+<!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en"> > <html> >-<head> >- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> >- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Windows NT 5.0; U) [Netscape]"> >- <title>JDT-APT FAQ</title> >-<link rel="stylesheet" href="http://dev.eclipse.org/default_style.css" type="text/css"> >-</head> >-<body text="#000000" bgcolor="#FFFFFF"> >- >- >-<table border=0 cellspacing=5 cellpadding=2 width="100%" > >- <tr> >- <td align=left width="72%"> <font class=indextop> FAQ </font> <br> >- <font class=indexsub> annotation processing in eclipse </font></td> >- <td width="28%"><img src="http://dev.eclipse.org/images/Idea.jpg" height=86 width=120></td> >- </tr> >-</table> >- >- >-<table border=0 cellspacing=5 cellpadding=2 width="100%" > >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"> >-<b><font face="Arial,Helvetica"><font color="#FFFFFF">Frequently Asked Questions</font></font></b></td> >-</tr> >- >-<tr> >-<td COLSPAN="2"> >- >-<ol> >- >-<b><li>What are annotations?</b> >-<p> >-Annotations are a simple metadata facility added to the Java language. Annotations can be >-used anywhere a modifier can be used, like <code>public</code>, <code>static</code>, and <code>final</code>. >-These annotations can be used at build or run-time in myriad ways. Here's an example annotation: >- >-<pre> >-public class Foo { >- >- <font color="#FF0000">@Override</font> >- public int hashCode() { >- return super.hashCode() ^ 1; >- } >-} >-</pre> >- >-This indicates that the method <code>hashCode</code> must override a method >-with the same signature in its superclass. If the method name were spelled wrong, a >-processor could notice this and issue an error. >- >-<p> >-Standard uses for annotation processors include EJB and Web Services generators. >- >-<p> >-Additional information on annotations can be found in the Java documentation >-<a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html">here</a>. >- >-<p> >-<b><li>When were annotations added to the Java language?</b> >-<p> >-Java 5 added annotation to the core language. >- >-<p> >-<b><li>How does jdt-apt extend basic JDT support?</b> >-<p> >-We hook into the JDT compiler. If an annotation is detected, we dispatch to any processors that >-claim that annotation. We then provide an implementation of the mirror APIs over the >-JDT typesystem. If a processor creates a new source file, we then call the necessary >-JDT APIs to perform compilation on that new file. >- >-<p> >-<b><li>Can I use an existing processor I wrote for the commandline "apt" tool inside of eclipse?</b> >-<p> >-Yes! This is one of the major goals of the jdt-apt project: you should be able to use an existing >-processor directly inside of eclipse and get an interactive experience, provided your processor is >-reasonably quick and efficient. >- >-<p> >-<b><li>Are the errors from my processor different from other JDT errors?</b> >-<p> >-No. They're treated just like any other error. >- >-<p> >-<b><li>Can I get quick-fixes inside annotation values?</b> >-<p> >-Yes. When you create your error markers via the Messager API, downcast >-to EclipseMessager, and use the printFixable...() APIs. These >-error markers can then be processed with a QuickFixProcessor via >-the JDT APIs in Eclipse.<p> >- >-</ol> >- >-</td> >-</tr> >- >- >-</table> >- >-<br> >-</body> >+ <head> >+ <meta http-equiv="refresh" content="0; url=faq.php" /> >+ </head> >+ <body> >+ <a href="faq.php">This page has moved. Please update your links and bookmarks.</a> >+ </body> > </html> >diff --git a/apt/faq.php b/apt/faq.php >new file mode 100644 >index 0000000..ccaa35e >--- /dev/null >+++ b/apt/faq.php >@@ -0,0 +1,98 @@ >+<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop' >+# >+# Begin: page-specific settings. Change these. >+$pageTitle = "JDT-APT FAQ"; >+$pageKeywords = "JDT, Java, UI, Debug, APT, java, development, tools, java ide, Eclipse"; >+$pageAuthor = "JDT/APT team"; >+# End: page-specific settings >+# Paste your HTML content between the markers! >+ob_start(); >+?> >+ >+<div id="midcolumn"> >+ <h1> >+ <?= $pageTitle ?> >+ </h1> >+ <div class="homeitem3col"> >+ <h3>Frequently Asked Questions</h3> >+ <ol> >+ <li> >+ <strong>What are annotations?</strong> >+ <p> >+ Annotations are a simple metadata facility added to the Java >+ language. Annotations can be used anywhere a modifier can be used, >+ like <code>public</code>, <code>static</code>, and <code>final</code>. >+ These annotations can be used at build or run-time in myriad ways. >+ Here's an example annotation: >+ <p> >+ <pre> >+public class Foo { >+ >+ <font color="#FF0000">@Override</font> >+ public int hashCode() { >+ return super.hashCode() ^ 1; >+ } >+} >+ </pre> >+ <p> >+ This indicates that the method <code>hashCode</code> >+ must override a method with the same signature in its superclass. >+ If the method name were spelled wrong, a processor could notice >+ this and issue an error. >+ </p> >+ <p> >+ Standard uses for annotation processors include EJB and Web Services generators. >+ </p> >+ <p> >+ Additional information on annotations can be found in the Java documentation >+ <a href="http://java.sun.com/j2se/1.5.0/docs/guide/language/annotations.html">here</a>. >+ </p> >+ </li> >+ <li> >+ <strong>When were annotations added to the Java language?</strong> >+ <p>Java 5 added annotation to the core language.</p> >+ </li> >+ <li> >+ <strong>How does jdt-apt extend basic JDT support?</strong> >+ <p> >+ We hook into the JDT compiler. If an annotation is detected, we >+ dispatch to any processors that claim that annotation. We then >+ provide an implementation of the mirror APIs over the JDT >+ typesystem. If a processor creates a new source file, we then call >+ the necessary JDT APIs to perform compilation on that new file. >+ </p> >+ </li> >+ <li> >+ <strong>Can I use an existing processor I wrote for the commandline "apt" tool inside of eclipse?</strong> >+ <p> >+ Yes! This is one of the major goals of the jdt-apt project: you >+ should be able to use an existing processor directly inside of >+ eclipse and get an interactive experience, provided your processor >+ is reasonably quick and efficient. >+ </p> >+ </li> >+ <li> >+ <strong>Are the errors from my processor different from other JDT errors?</strong> >+ <p> >+ No. They're treated just like any other error. >+ </p> >+ </li> >+ <li> >+ <strong>Can I get quick-fixes inside annotation values?</strong> >+ <p> >+ Yes. When you create your error markers via the Messager API, >+ downcast to EclipseMessager, and use the printFixable...() APIs. >+ These error markers can then be processed with a QuickFixProcessor >+ via the JDT APIs in Eclipse. >+ </p> >+ </li> >+ </ol> >+ </div> >+</div> >+<?php >+$html = ob_get_contents(); >+ob_end_clean(); >+ >+# Generate the web page >+$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); >+?> >\ No newline at end of file >diff --git a/apt/index.html b/apt/index.html >index 3f4c283..2d07f74 100644 >--- a/apt/index.html >+++ b/apt/index.html >@@ -1,25 +1,9 @@ >- >-<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> >+<!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en"> > <html> >-<head> >-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> >-<title>Eclipse JDT-APT Project</title> >-</head> >-<frameset rows="48,*" frameborder=0 framespacing=0 border="0"> >- <frame name="banner" scrolling="no" noresize target="home" >- src="../../eproject-banner.html" marginwidth="0" marginheight="0" frameborder="NO"> >- <frameset cols="126,*" frameborder=0 framespacing=0 border="0"> >- <frameset rows="220, *" frameborder=0 framespacing=0 border="0"> >- <frame name="home_nav" scrolling="no" noresize target="main" >- src="../../home_nav.html" marginwidth="0" marginheight="0" frameborder="NO"> >- <frame name="nav" scrolling="no" noresize target="main" >- src="../../eclipse/nav.html" marginwidth="0" marginheight="0" frameborder="NO"> >- </frameset> >- <frame name="main" marginwidth=10 marginheight=10 noresize frameborder="NO" src="main.html"> >- </frameset> >- <noframes> >- <body> >- <p>This page uses frames, but your browser doesn't support them.</p> >- </body> >- </noframes> </frameset> >-</html> >+ <head> >+ <meta http-equiv="refresh" content="0; url=index.php" /> >+ </head> >+ <body> >+ <a href="index.php">This page has moved. Please update your links and bookmarks.</a> >+ </body> >+</html> >\ No newline at end of file >diff --git a/apt/index.php b/apt/index.php >new file mode 100644 >index 0000000..7846f0d >--- /dev/null >+++ b/apt/index.php >@@ -0,0 +1,123 @@ >+<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop' >+# >+# Begin: page-specific settings. Change these. >+$pageTitle = "Eclipse JDT-APT Project"; >+$pageKeywords = "JDT, Java, UI, Debug, APT, java, development, tools, java ide, Eclipse"; >+$pageAuthor = "JDT/APT team"; >+# End: page-specific settings >+# Paste your HTML content between the markers! >+ob_start(); >+?> >+ >+<div id="midcolumn"> >+ <h1> >+ <?= $pageTitle ?> >+ </h1> >+ <div class="homeitem3col"> >+ <h3>What is the JDT-APT project?</h3> >+ <p> >+ The JDT-APT project provides plugins that add Java 5 annotation >+ processing support to Eclipse. A Java annotation processor is a >+ compiler plug-in that can gather information about source code as it >+ is being compiled, generate additional Java types or other resource >+ files, and post warnings and errors. Eclipse 3.2 provided support for >+ annotation processors using the <a href="http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/overview-summary.html">Java 5 Mirror APIs</a>, >+ and Eclipse 3.3 added support for processors using the <a href="http://java.sun.com/javase/6/docs/api/javax/annotation/processing/package-summary.html"> >+ Java 6 annotation processing APIs</a>. >+ </p> >+ <p> >+ You can view the presentation given at JavaOne 2005 during a session >+ on APT that describes some of the goals and technical details <a >+ href="javaone_apt.ppt">here</a>. At EclipseCon 2006 we made a <a >+ href="Eclipsecon2006.ppt">presentation</a> on APT do's and don'ts, >+ and at EclipseCon 2007 this was developed into a <a >+ href="eclipsecon2007.zip">tutorial</a> on writing annotation >+ processors for Eclipse, including some sample code and more >+ discussion of techniques to achieve good performance. At EclipseCon >+ 2008 we gave a <a href="eclipsecon2008.ppt">presentation</a> on >+ annotations (which briefly mentions annotation processors but does >+ not go into depth) that may be of interest to those looking for >+ background material or for alternative strategies to annotation >+ processing. >+ </p> >+ <p> >+ Additional frequently asked questions and their answers can be found >+ in our <a href="faq.php">FAQ</a>. >+ </p> >+ </div> >+ <div class="homeitem3col"> >+ <h3>What is APT?</h3> >+ <p> >+ APT stands for Annotation Processing Tool. Sun shipped an API for APT >+ in JDK 1.5, which can be viewed at <a >+ href="http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/index.html"> >+ http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/index.html</a>. >+ Sun also included a commandline implementation of APT in JDK 1.5. You >+ can find documentation for it at <a >+ href="http://java.sun.com/j2se/1.5.0/docs/guide/apt/index.html" >+ target="_blank">http://java.sun.com/j2se/1.5.0/docs/guide/apt/index.html</a>. >+ In JDK 6, the API was modified considerably and standardized through >+ JSR-269, and the Sun implementation was built into the javac compiler >+ rather than requiring a standalone tool. >+ </p> >+ <p>To quote from Sun's documentation:</p> >+ <p> >+ <code> >+ apt is a command-line utility for annotation processing. It includes >+ a set of reflective APIs and supporting infrastructure to process >+ program annotations (JSR 175). These reflective APIs provide a >+ build-time, source-based, read-only view of program structure. They >+ are designed to cleanly model the Java<sup><small>TM</small> >+ </sup> programming language's type system after the addition of >+ generics (JSR 14). >+ </code> >+ </p> >+ <p> >+ So, APT provides a means for generating files and compiling new >+ java classes based on annotations found in your source code. >+ </p> >+ <p> >+ JDT-APT is not based on Sun's implementation, but rather is a >+ separate implementation of the APT APIs that runs entirely within >+ Eclipse. >+ </p> >+ </div> >+ <div class="homeitem3col"> >+ <h3>How do I get started?</h3> >+ <p> >+ If all you need to do is use an annotation processor, you may not >+ need to do anything at all! Many project creation wizards will >+ automatically install and enable the necessary processors. To check >+ whether this is the case, or to install and enable your own >+ processors, use the Java Compiler -> Annotation Processing pane of >+ the project properties.</p> >+ <p> >+ If you need to write your own annotation processor, see <a >+ href="introToAPT.php">Intro to APT</a> to get started using APT, >+ and also see the EclipseCon 2007 tutorial mentioned above. >+ </p> >+ </div> >+ <div class="homeitem3col"> >+ <h3>How can I contribute?</h3> >+ <p> >+ If you're interested in contributing, start by checking the code out of CVS. >+ See the instructions <a href="howtobuildme.txt">here</a>. >+ </p> >+ <p> >+ You can also check out the mailing list, >+ <a href="http://dev.eclipse.org/mailman/listinfo/jdt-apt-dev">jdt-apt-dev@eclipse.org</a>, >+ or post questions to the eclipse.tools.jdt >+ <a href="http://www.eclipse.org/newsgroups/">newsgroup</a>. >+ The mailing list is primarily for announcements and discussion by people working >+ on the APT tooling in Eclipse; if you have technical questions, it is >+ best to use the newsgroup. >+ </p> >+ </div> >+</div> >+<?php >+$html = ob_get_contents(); >+ob_end_clean(); >+ >+# Generate the web page >+$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); >+?> >\ No newline at end of file >diff --git a/apt/introToAPT.html b/apt/introToAPT.html >index 389f1f6..38b7ba8 100644 >--- a/apt/introToAPT.html >+++ b/apt/introToAPT.html >@@ -1,162 +1,9 @@ >-<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> >+<!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en"> > <html> >-<head> >- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> >- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Windows NT 5.0; U) [Netscape]"> >- <title>Introduction to Annotation Processing in Eclipse</title> >-<link rel="stylesheet" href="http://dev.eclipse.org/default_style.css" type="text/css"> >-</head> >-<body text="#000000" bgcolor="#FFFFFF"> >- >- >-<table border=0 cellspacing=5 cellpadding=2 width="100%" > >- <tr> >- <td align=left width="72%"> <font class=indextop> Introduction to the Annotation Processing Feature </font> <br> >- <font class=indexsub> annotation processing in eclipse </font></td> >- <td width="28%"><img src="http://dev.eclipse.org/images/Idea.jpg" height=86 width=120></td> >- </tr> >-</table> >- >- >-<table border=0 cellspacing=5 cellpadding=2 width="100%" > >- >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF">Disclaimer</font></font></b></td> >-</tr> >-<tr> >-<td COLSPAN="2"> >-This is a BETA release. All APIs contained herein are provisional, and subject to change with subsequent updates. >- >- >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF">Testing your APT installation</font></font></b></td> >-</tr> >- >-<tr> >-<td COLSPAN="2"> >-The APT feature is part of Eclipse 3.2, as of M5a and later. >- >-If you wish to use Eclipse 3.1, see the <a href="installOn3.1.html">3.1 installation instructions</a>. >-<p> >- >-You can verify the installation on either version this way: >-<ul> >-<li>Create a Java project which contains the file <a href="APTDemo.jar">APTDemo.jar</a> in its filesystem.</li> >-<li>Open the project properties dialog, and go to the Java Compiler / Annotation Processing panel.</li> >-<li>Check "Enable Project Specific Settings" and "Enable Annotation Processing".</li> >-<li>Now open the Java Compiler / Annotation Processing / Factory Path panel.</li> >-<li>Click on Add Jars... and add the APTDemo.jar.</li> >-<li>Create a new Class, and annotate the class in the source file with @DemoAnnotation(what = "spam").</li> >-</ul> >- >-The "spam" value should be squiggled, with the message "I don't like spam". >- >-<ul> >-<li>Annotate the same class with @TypeGeneratingAnnotation</li> >-<li>Build the project.</li> >-</ul> >- >-A new source directory should appear in the project, named .apt_generated, that will contain a generated >-Java source file called GeneratedFileTest.java. <i>The generated source directory will not be visible by >-default in the Package Explorer, because it starts with a '.', but it will be visible in the Navigator.</i> >- >- >- >-</td> >-</tr> >- >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF">Installing and Configuring >-Annotation Processors</font></font></b></td> >-</tr> >-<tr> >-<td COLSPAN="2"><font color="#000000"> >-An annotation processor can run in Eclipse from a .jar file contained in a project, a .jar file external to the workspace, or a plugin. >-Jars are added to a workspace or project though the Properties Dialog, Factory Path pane: >-<p> >- >-<img src="PropertiesDialog.gif"> >- >-<p> >-For an example of how to set up a plugin project to develop a processor, download <a href="APTDemo.jar">APTDemo.jar</a> and explode it into a workspace and import it as an existing >-project. Eclipse locates plugins along a factory path, which can be configured at the workspace or project level. Workspace configuration >-is picked up as the default for projects that have annotation processing enabled (see the Properties dialog shown above). If the factory >-path is configured for an individual project, that project will no longer see changes to the workspace configuration; you will have to >-update it manually. >- >-<p> >-A plugin that contains a factory must extend the annotationProcessorFactory extension point. Here is the example from the plugin >-in APTDemo.jar. Each Factory class contained in the plugin must be named in the class=attribute. >-<pre> >- <extension >- point="org.eclipse.jdt.apt.core.annotationProcessorFactory"> >- <factories enableDefault="true"> >- <factory >- class="demo.TypeGeneratingAnnotationProcessorFactory"> >- </factory> >- <factory >- class="demo.DemoAnnotationProcessorFactory"> >- </factory> >- </factories> >- </extension> >-</pre> >-More details about this will follow when we deliver an SDK version of the feature. >- >- >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF">Debugging Annotation Processors in >-Eclipse</font></font></b></td> >-</tr> >-<tr> >-<td COLSPAN="2"><font color="#000000"> >-To debug an annotation processor it must be run from a plugin. You develop your code in the plugin, and then debug it by >-annotating source code in a spawned instance of >-Eclipse. The debugging instance needs the annotation declaration, the factory, and the processor. The spawned instance >-only needs access to the declaration. >- >- >-</font></td> >-</tr> >- >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF"> >-Problems and Bugs</font></font></b></td> >-</tr> >-<tr> >-<td COLSPAN="2"><font color="#000000"> >-Symptom: nothing happens, no errors in log file. >-<ul> >-<li>Make sure that annotation processing is enabled in the Project Properties.</li> >-</ul> >-<p> >-Symptom: annotations not getting processed, log file contains "Bundle not resolved" warnings, ClassNotFound errors or "No Classloader found" errors. >-<ul> >-<li>Make sure that you are using a 1.5 JVM to run Eclipse. Although most of Eclipse can run on a 1.4 JVM, the APT plugins require a 1.5 JVM.</li> >-</ul> >- >-<p> >-Please post questions to the JDT newsgroup (eclipse.tools.jdt). Post bugs related to this feature in Bugzilla, under Product JDT, Component APT. >- >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF">Feature Enable/Disable in Eclipse 3.1.2</font></font></b></td> >-</tr> >-<tr> >-<td COLSPAN="2"><font color="#000000"> >-If you installed APT as an update to Eclipse 3.1.2 and you have a problem with the compiler, you can disable the feature through the Product Configuration dialog >-(Menu item Help / Software Updates / Manage Configuration). >-<p> >-<img src="ProductConfigDialog.jpg"> >- >-<p> >-Select the JdtAptFeature from your Eclipse installation and click <b>Disable</b>. >-Your Eclipse will now use the unchanged, original version of the compiler. To re-enable the feature you need to click on the Show Disabled >-Features on the toolbar of this dialog. >- >- >-</td> >-</tr> >-</table> >- >-<br> >-</body> >-</html> >+ <head> >+ <meta http-equiv="refresh" content="0; url=introToAPT.php" /> >+ </head> >+ <body> >+ <a href="introToAPT.php">This page has moved. Please update your links and bookmarks.</a> >+ </body> >+</html> >\ No newline at end of file >diff --git a/apt/introToAPT.php b/apt/introToAPT.php >new file mode 100644 >index 0000000..2700e9a >--- /dev/null >+++ b/apt/introToAPT.php >@@ -0,0 +1,138 @@ >+<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon()); # All on the same line to unclutter the user's desktop' >+# >+# Begin: page-specific settings. Change these. >+$pageTitle = "Introduction to Annotation Processing in Eclipse"; >+$pageKeywords = "JDT, Java, UI, Debug, APT, java, development, tools, java ide, Eclipse"; >+$pageAuthor = "JDT/APT team"; >+# End: page-specific settings >+# Paste your HTML content between the markers! >+ob_start(); >+?> >+ >+<div id="midcolumn"> >+ <h1> >+ <?= $pageTitle ?> >+ </h1> >+ <div class="homeitem3col"> >+ <h3>Disclaimer</h3> >+ <p> >+ This is a BETA release. All APIs contained herein are provisional, and subject to change with subsequent updates. >+ </p> >+ </div> >+ <div class="homeitem3col"> >+ <h3>Testing your APT installation</h3> >+ <p> >+ The APT feature is part of Eclipse 3.2, as of M5a and later. If you wish to use Eclipse 3.1, >+ see the <a href="installOn3.1.html">3.1 installation instructions</a>. >+ </p> >+ <p>You can verify the installation on either version this way:</p> >+ <ul> >+ <li>Create a Java project which contains the file <a href="APTDemo.jar">APTDemo.jar</a> in its filesystem.</li> >+ <li>Open the project properties dialog, and go to the Java Compiler / Annotation Processing panel.</li> >+ <li>Check "Enable Project Specific Settings" and "Enable Annotation Processing".</li> >+ <li>Now open the Java Compiler / Annotation Processing / Factory Path panel.</li> >+ <li>Click on Add Jars... and add the APTDemo.jar.</li> >+ <li>Create a new Class, and annotate the class in the source file with @DemoAnnotation(what = "spam").</li> >+ </ul> >+ <p>The "spam" value should be squiggled, with the message "I don't like spam".</p> >+ <ul> >+ <li>Annotate the same class with @TypeGeneratingAnnotation</li> >+ <li>Build the project.</li> >+ </ul> >+ <p> >+ A new source directory should appear in the project, named .apt_generated, that will contain a >+ generated Java source file called GeneratedFileTest.java. <i>The generated source directory >+ will not be visible by default in the Package Explorer, because it starts with a '.', but it >+ will be visible in the Navigator.</i> >+ </p> >+ </div> >+ <div class="homeitem3col"> >+ <h3>Installing and Configuring Annotation Processors</h3> >+ <p> >+ An annotation processor can run in Eclipse from a .jar file contained in a project, a .jar file >+ external to the workspace, or a plugin. Jars are added to a workspace or project though >+ the Properties Dialog, Factory Path pane: >+ </p> >+ <img src="PropertiesDialog.gif"> >+ <p> >+ For an example of how to set up a plugin project to develop a processor, download >+ <a href="APTDemo.jar">APTDemo.jar</a> and explode it into a workspace and import it as an >+ existing project. Eclipse locates plugins along a factory path, which can be configured at the >+ workspace or project level. Workspace configuration is picked up as the default for projects >+ that have annotation processing enabled (see the Properties dialog shown above). If the >+ factory path is configured for an individual project, that project will no longer see changes >+ to the workspace configuration; you will have to update it manually. >+ </p> >+ <p> >+ A plugin that contains a factory must extend the annotationProcessorFactory extension >+ point. Here is the example from the plugin in APTDemo.jar. Each Factory class contained in the >+ plugin must be named in the class=attribute. >+ </p> >+ <pre> >+ <extension >+ point="org.eclipse.jdt.apt.core.annotationProcessorFactory"> >+ <factories enableDefault="true"> >+ <factory >+ class="demo.TypeGeneratingAnnotationProcessorFactory"> >+ </factory> >+ <factory >+ class="demo.DemoAnnotationProcessorFactory"> >+ </factory> >+ </factories> >+ </extension> >+ </pre> >+ <p> >+ More details about this will follow when we deliver an SDK version of the feature. >+ </p> >+ </div> >+ <div class="homeitem3col"> >+ <h3>Debugging Annotation Processors in Eclipse</h3> >+ <p> >+ To debug an annotation processor it must be >+ run from a plugin. You develop your code in the plugin, and then debug it by annotating >+ source code in a spawned instance of Eclipse. The debugging instance needs the annotation >+ declaration, the factory, and the processor. The spawned instance only needs access to the >+ declaration. >+ </p> >+ </div> >+ <div class="homeitem3col"> >+ <h3>Problems and Bugs</h3> >+ <div> >+ <p>Symptom: nothing happens, no errors in log file.</p> >+ <ul> >+ <li>Make sure that annotation processing is enabled in the Project Properties.</li> >+ </ul> >+ <p>Symptom: annotations not getting processed, log file contains "Bundle not resolved" >+ warnings, ClassNotFound errors or "No Classloader found" errors.</p> >+ <ul> >+ <li>Make sure that you are using a 1.5 JVM to run Eclipse. Although most of Eclipse >+ can run on a 1.4 JVM, the APT plugins require a 1.5 JVM.</li> >+ </ul> >+ <p>Please post questions to the JDT newsgroup (eclipse.tools.jdt). Post bugs related to >+ this feature in Bugzilla, under Product JDT, Component APT. >+ </p> >+ </div> >+ </div> >+ <div class="homeitem3col"> >+ <h3>Feature Enable/Disable in Eclipse 3.1.2</h3> >+ <p> >+ If you installed APT as an update to >+ Eclipse 3.1.2 and you have a problem with the compiler, you can disable the feature >+ through the Product Configuration dialog (Menu item Help / Software Updates / >+ Manage Configuration). >+ </p> >+ <img src="ProductConfigDialog.jpg"> >+ <p> >+ Select the JdtAptFeature from your Eclipse installation and click <b>Disable</b>. Your >+ Eclipse will now use the unchanged, original version of the compiler. To re-enable the >+ feature you need to click on the Show Disabled Features on the toolbar of this dialog. >+ </p> >+ </div> >+</div> >+<?php >+$html = ob_get_contents(); >+ob_end_clean(); >+ >+# Generate the web page >+$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html); >+?> >\ No newline at end of file >diff --git a/apt/main.html b/apt/main.html >index e9b64e9..7faeccf 100644 >--- a/apt/main.html >+++ b/apt/main.html >@@ -1,133 +1,10 @@ >-<!doctype html public "-//w3c//dtd html 4.0 transitional//en"> >+<!DOCTYPE html public "-//w3c//dtd html 4.0 transitional//en"> > <html> >-<head> >- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> >- <meta name="GENERATOR" content="Mozilla/4.73 [en] (Windows NT 5.0; U) [Netscape]"> >- <title>JDT-APT Project</title> >-<link rel="stylesheet" href="http://dev.eclipse.org/default_style.css" type="text/css"> >-</head> >-<body text="#000000" bgcolor="#FFFFFF"> >- >- >-<table border=0 cellspacing=5 cellpadding=2 width="100%" > >- <tr> >- <td align=left width="72%"> <font class=indextop> jdt-apt </font> <br> >- <font class=indexsub> annotation processing in eclipse </font></td> >- <td width="28%"><img src="http://dev.eclipse.org/images/Idea.jpg" height=86 width=120></td> >- </tr> >-</table> >- >- >-<table border=0 cellspacing=5 cellpadding=2 width="100%" > >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF">What is the JDT-APT project?</font></font></b></td> >-</tr> >- >-<tr> >-<td COLSPAN="2">The JDT-APT project provides plugins that add Java 5 annotation processing support to Eclipse. >- >-A Java annotation processor is a compiler plug-in that can gather information about source code as >-it is being compiled, generate additional Java types or other resource files, and post warnings >-and errors. Eclipse 3.2 provided support for annotation processors using the >-<a href="http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/overview-summary.html">Java 5 Mirror APIs</a>, >-and Eclipse 3.3 added support for processors using the >-<a href="http://java.sun.com/javase/6/docs/api/javax/annotation/processing/package-summary.html"> >-Java 6 annotation processing APIs</a>.</p> >-<p> >-You can view the presentation given at JavaOne 2005 during a session on APT that describes some of the goals >-and technical details <a href="javaone_apt.ppt">here</a>. At EclipseCon 2006 we made a >-<a href="Eclipsecon2006.ppt">presentation</a> on APT do's and don'ts, and at EclipseCon 2007 this was >-developed into a <a href="eclipsecon2007.zip">tutorial</a> on writing annotation processors for Eclipse, >-including some sample code and more discussion of techniques to achieve good performance. At EclipseCon 2008 >-we gave a <a href="eclipsecon2008.ppt">presentation</a> on annotations (which briefly mentions annotation >-processors but does not go into depth) that may be of interest to those looking for background material >-or for alternative strategies to annotation processing. >- >-<p> >-Additional frequently asked questions and their answers can be found in our <a href="faq.html">FAQ</a>. >- >-</td> >-</tr> >- >-<tr> >-<td COLSPAN="2" ALIGN=LEFT VALIGN=TOP BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF"> >-What is APT?</font></font></b></td> >-</tr> >-<tr> >-<td COLSPAN="2"><font color="#000000">APT stands for Annotation Processing Tool. >-Sun shipped an API for APT in JDK 1.5, which can be viewed at >-<a href="http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/index.html"> >-http://java.sun.com/j2se/1.5.0/docs/guide/apt/mirror/index.html</a>. Sun also included a commandline >-implementation of APT in JDK 1.5. You can find documentation for it at >-<a href="http://java.sun.com/j2se/1.5.0/docs/guide/apt/index.html" target="_blank">http://java.sun.com/j2se/1.5.0/docs/guide/apt/index.html</a>. >-In JDK 6, the API was modified considerably and standardized through JSR-269, and the Sun implementation was >-built into the javac compiler rather than requiring a standalone tool. >-<p> >-To quote from Sun's documentation: >-<p> >-<code> >-apt is a command-line utility for annotation processing. >-It includes a set of reflective APIs and supporting infrastructure to >-process program annotations (JSR 175). >-These reflective APIs provide a build-time, source-based, >-read-only view of program structure. They are designed to cleanly model >-the Java<sup><small>TM</small></sup> >-programming language's type system after the addition of generics (JSR 14). >-</code> >- >-<p> >-So, APT provides a means for generating files and compiling new java classes based on annotations >-found in your source code. >- >-<p> >-JDT-APT is not based on Sun's implementation, but rather is a separate implementation of >-the APT APIs that runs entirely within Eclipse. >- >-</font></td> >-</tr> >- >- >- >- >-<tr><td ALIGN=LEFT VALIGN=TOP COLSPAN="2" BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF"> >-How do I get started?</font></font></b> >-</td></tr> >- >-<tr> >-<td COLSPAN="2"><font color="#000000"> >-<p> >-If all you need to do is use an annotation processor, you may not need to do anything at all! Many project >-creation wizards will automatically install and enable the necessary processors. To check whether this >-is the case, or to install and enable your own processors, use the Java Compiler -> Annotation Processing >-pane of the project properties. >-<p> >-If you need to write your own annotation processor, see <a href="introToAPT.html">Intro to APT</a> to get >-started using APT, and also see the EclipseCon 2007 tutorial mentioned above. >-</font></td> >-</tr> >- >- >-<tr> >-<td ALIGN=LEFT VALIGN=TOP COLSPAN="2" BGCOLOR="#0080C0"><b><font face="Arial,Helvetica"><font color="#FFFFFF"> >-How can I contribute?</font></font></b></td> >-</tr> >- >-<tr> >-<td COLSPAN="2">If you're interested in contributing, start by checking the code out of CVS. See the instructions >-<a href="howtobuildme.txt">here</a>. >- >-<p> >-You can also check out the mailing list, >-<a href="http://dev.eclipse.org/mailman/listinfo/jdt-apt-dev">jdt-apt-dev@eclipse.org</a>, >-or post questions to the eclipse.tools.jdt <a href="http://www.eclipse.org/newsgroups/">newsgroup</a>. >-The mailing list is primarily for announcements and discussion by people working on the APT tooling >-in Eclipse; if you have technical questions, it is best to use the newsgroup. >- >- >-</td> >-</tr> >-</table> >- >-<br> >-</body> >-</html> >+ <head> >+ <meta http-equiv="refresh" content="0; url=index.php" /> >+ </head> >+ <body> >+ <a href="index.php">This page has moved. Please update your links >+and bookmarks.</a> >+ </body> >+</html> >\ No newline at end of file
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 213636
: 223427 |
223428