[jboss-cvs] JBossAS SVN: r92432 - in projects/annotations/trunk: doc/userguide/en and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Mon Aug 17 11:23:34 EDT 2009


Author: jesper.pedersen
Date: 2009-08-17 11:23:33 -0400 (Mon, 17 Aug 2009)
New Revision: 92432

Added:
   projects/annotations/trunk/doc/userguide/en/modules/ant.xml
Modified:
   projects/annotations/trunk/build.xml
   projects/annotations/trunk/doc/userguide/en/master.xml
   projects/annotations/trunk/doc/userguide/en/modules/about.xml
   projects/annotations/trunk/doc/userguide/en/modules/installation.xml
   projects/annotations/trunk/doc/userguide/en/modules/introduction.xml
   projects/annotations/trunk/doc/userguide/en/modules/usage.xml
   projects/annotations/trunk/indexer/src/main/java/org/jboss/annotations/indexer/IndexerTask.java
Log:
[JBANN-23] Describe functionality

Modified: projects/annotations/trunk/build.xml
===================================================================
--- projects/annotations/trunk/build.xml	2009-08-17 15:12:21 UTC (rev 92431)
+++ projects/annotations/trunk/build.xml	2009-08-17 15:23:33 UTC (rev 92432)
@@ -341,6 +341,12 @@
       </fileset>
     </move>
 
+    <copy todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/doc">
+      <fileset dir="core/src/main/resources">
+        <include name="*.xsd"/>
+      </fileset>
+    </copy>
+
     <copy todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}">
       <fileset dir="${target.dir}">
         <include name="*.jar"/>
@@ -350,7 +356,7 @@
     <copy todir="${build.dir}/${name}-${major}.${minor}.${patch}.${type}/lib">
       <fileset dir="${lib.dir}/core">
         <include name="*.jar"/>
-        <exclude name="*xjc.jar"/>
+        <exclude name="ant.jar"/>
       </fileset>
     </copy>
 

Modified: projects/annotations/trunk/doc/userguide/en/master.xml
===================================================================
--- projects/annotations/trunk/doc/userguide/en/master.xml	2009-08-17 15:12:21 UTC (rev 92431)
+++ projects/annotations/trunk/doc/userguide/en/master.xml	2009-08-17 15:23:33 UTC (rev 92432)
@@ -6,6 +6,7 @@
         <!ENTITY download SYSTEM "modules/download.xml">
         <!ENTITY nc_installation SYSTEM "modules/installation.xml">
         <!ENTITY usage SYSTEM "modules/usage.xml">
+        <!ENTITY ant SYSTEM "modules/ant.xml">
         <!ENTITY community SYSTEM "modules/community.xml">
         <!ENTITY troubleshooting SYSTEM "modules/troubleshooting.xml">
         ]>
@@ -26,6 +27,8 @@
 
    &usage;
 
+   &ant;
+
    &community;
 
    &troubleshooting;

Modified: projects/annotations/trunk/doc/userguide/en/modules/about.xml
===================================================================
--- projects/annotations/trunk/doc/userguide/en/modules/about.xml	2009-08-17 15:12:21 UTC (rev 92431)
+++ projects/annotations/trunk/doc/userguide/en/modules/about.xml	2009-08-17 15:23:33 UTC (rev 92432)
@@ -18,7 +18,7 @@
     <title>Thanks to</title>
 
     <para>
-      Jason Greene, David Lloyd, Andrew Lee Rubinger and Scott Stark.
+      Jason Greene, David Lloyd, Scott Marlow, Andrew Lee Rubinger and Scott Stark.
     </para>
   </section>
 

Added: projects/annotations/trunk/doc/userguide/en/modules/ant.xml
===================================================================
--- projects/annotations/trunk/doc/userguide/en/modules/ant.xml	                        (rev 0)
+++ projects/annotations/trunk/doc/userguide/en/modules/ant.xml	2009-08-17 15:23:33 UTC (rev 92432)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<chapter id="ant">
+  <title>Apache Ant integration</title>
+
+  <para>The JBoss Annotations project features the following Apache Ant tasks.</para>
+
+  <section id="indexertask">
+    <title>The Indexer task</title>
+
+    <para>The jboss-annotations-indexer.jar file contains the Indexer task for the project.</para>
+
+    <programlisting>
+&lt;taskdef name="indexer" classname="org.jboss.annotations.indexer.IndexerTask"/&gt;
+    </programlisting>
+
+    <para>The Indexer will generate the project specific metadata files which describes
+      where annotations are located, such that the entire archive doesn't have to be
+      scanned.</para>
+
+    <para>The task has the following attributes:</para>
+
+    <table frame="all">
+      <title>Indexer attributes</title>
+      <tgroup cols="2" align="left" colsep="1" rowsep="1">
+        <colspec colname="c1"/>
+        <colspec colname="c2" colwidth="3*"/>
+        <thead>
+          <row>
+            <entry align="left">Element</entry>
+            <entry align="left">Description</entry>
+          </row>
+        </thead>
+        <tbody>
+          <row>
+            <entry>input</entry>
+            <entry>
+              The input Jar fiile (Required).
+            </entry>
+          </row>
+          <row>
+            <entry>output</entry>
+            <entry>
+              The output Jar file (Optional - Default: Same as input).
+            </entry>
+          </row>
+          <row>
+            <entry>mode</entry>
+            <entry>
+              The metadata mode: xml|binary|both (Default: both)
+              <para>xml = 'jboss-annotation.xml', binary = 'jboss-annotation.ser'</para>
+            </entry>
+          </row>
+          <row>
+            <entry>update</entry>
+            <entry>
+              Should the output file be updated with metadata ? (Default: true).
+            </entry>
+          </row>
+          <row>
+            <entry>metadata</entry>
+            <entry>
+              The metadata location if update is false (Default: Current directory).
+            </entry>
+          </row>
+        </tbody>
+      </tgroup>
+    </table>
+
+    <para>Example:</para>
+    <programlisting>
+&lt;indexer input="myjarfile.jar"/&gt;
+    </programlisting>
+  </section>
+
+</chapter>

Modified: projects/annotations/trunk/doc/userguide/en/modules/installation.xml
===================================================================
--- projects/annotations/trunk/doc/userguide/en/modules/installation.xml	2009-08-17 15:12:21 UTC (rev 92431)
+++ projects/annotations/trunk/doc/userguide/en/modules/installation.xml	2009-08-17 15:23:33 UTC (rev 92432)
@@ -62,13 +62,10 @@
    <section id="projectdependencies">
      <title>Dependencies</title>
      
-     <para>The JBoss Annotations project has the following dependencies:</para>
+     <para>The JBoss Annotations project has the following optional run-time dependency:</para>
      
      <itemizedlist spacing="compact">
        <listitem>
-         JAXB 2.1: XML binding framework
-       </listitem>
-       <listitem>
          Javassist: Advanced Java bytecode library
        </listitem>
      </itemizedlist>

Modified: projects/annotations/trunk/doc/userguide/en/modules/introduction.xml
===================================================================
--- projects/annotations/trunk/doc/userguide/en/modules/introduction.xml	2009-08-17 15:12:21 UTC (rev 92431)
+++ projects/annotations/trunk/doc/userguide/en/modules/introduction.xml	2009-08-17 15:23:33 UTC (rev 92432)
@@ -2,7 +2,7 @@
 <chapter id="introduction">
    <title>Introduction</title>
 
-   <para>JBoss Annotations is a project that will scan for annotations in .class and .jar files
+   <para>JBoss Annotations is a project that will scan for annotations in .jar files
      and let the developer interact with the generated annotation repository.</para>
 
    <para>The project is split into various areas:</para>
@@ -14,12 +14,67 @@
        Tools: Various tools
        <itemizedlist spacing="compact">
          <listitem>
-           Indexer: An index tool that can generate a jboss-annotation.xml file (under development).
+           Indexer: An index tool that can generate jboss-annotation.xml and jboss-annotation.ser files.
          </listitem>
        </itemizedlist>
      </listitem>
    </itemizedlist>
 
-   <para>Feel free to send feedback to the author directly.</para>
+   <section id="corefunctionality">
+      <title>Core functionality</title>
 
+      <para>The core functionality of the JBoss Annotations project is to scan for
+        annotations and build a repository that can be queried.</para>
+
+      <para>The project scans for annotations at</para>
+
+      <itemizedlist spacing="compact">
+        <listitem>
+          Class level: Annotations located on interface or class definitions.
+        </listitem>
+        <listitem>
+          Field level: Annotations located on fields (private to public).
+        </listitem>
+        <listitem>
+          Constructor level: Annotations located on constructors (private to public).
+        </listitem>
+        <listitem>
+          Method level: Annotations located on methods (private to public).
+        </listitem>
+      </itemizedlist>
+
+      <para>Parameter level annotation scanning is on the project's roadmap (JBANN-14).</para>
+
+      <para>Also on the roadmap is the ability to define which of the above levels
+        that should be scanned (JBANN-13).</para>
+
+      <section id="metadata">
+        <title>Metadata</title>
+
+        <para>The scanner uses the metadata files</para>
+
+        <itemizedlist spacing="compact">
+          <listitem>
+            META-INF/jboss-annotation.ser (Binary)
+          </listitem>
+          <listitem>
+            META-INF/jboss-annotation.xml (XML)
+          </listitem>
+        </itemizedlist>
+
+        <para>to limit the scanning needed for each archive.</para>
+
+        <para>The format of the XML file can be found in the file</para>
+
+        <programlisting>
+jboss-annotation.xsd
+        </programlisting>
+
+        <para>Both metadata file types can be created by using the Indexer Ant task.</para>
+
+      </section>
+
+   </section>
+
+
 </chapter>

Modified: projects/annotations/trunk/doc/userguide/en/modules/usage.xml
===================================================================
--- projects/annotations/trunk/doc/userguide/en/modules/usage.xml	2009-08-17 15:12:21 UTC (rev 92431)
+++ projects/annotations/trunk/doc/userguide/en/modules/usage.xml	2009-08-17 15:23:33 UTC (rev 92432)
@@ -18,7 +18,7 @@
 // Create an annotation scanner instance (default strategy)
 AnnotationScanner as = AnnotationScannerFactory.getDefault();
 
-// URLs which points to .class and .jar files
+// URLs which points to .jar files
 URL[] urls = ...;
 
 // Scan the urls

Modified: projects/annotations/trunk/indexer/src/main/java/org/jboss/annotations/indexer/IndexerTask.java
===================================================================
--- projects/annotations/trunk/indexer/src/main/java/org/jboss/annotations/indexer/IndexerTask.java	2009-08-17 15:12:21 UTC (rev 92431)
+++ projects/annotations/trunk/indexer/src/main/java/org/jboss/annotations/indexer/IndexerTask.java	2009-08-17 15:23:33 UTC (rev 92432)
@@ -23,6 +23,7 @@
 package org.jboss.annotations.indexer;
 
 import java.io.File;
+import java.io.IOException;
 import java.util.logging.Logger;
 
 import org.apache.tools.ant.BuildException;
@@ -205,6 +206,17 @@
             }
             else
             {
+               if (metadata.exists())
+               {
+                  if (metadata.isFile())
+                     throw new IOException("Metadata should be a directory: " + metadata);
+               }
+               else
+               {
+                  if (!metadata.mkdirs())
+                     throw new IOException("Unable to create directory: " + metadata);
+               }
+
                File xmlFile = null;
                if (xml)
                {




More information about the jboss-cvs-commits mailing list