The following comment has been added to this issue:

     Author: Sylvain Vieujot
    Created: Sun, 3 Oct 2004 8:38 AM
       Body:
For the one impatients of using jdk5 like me, here is a workaround I use to be able to 
get generics, and still have xdoclet running :

I add a small ant task that parse all my sources with a regex, removing all the 
generics, and all the declaration of the foreach loops.

The resulting code isn't functional, but it's good enough to run xdoclet on it.

Note, the regex works fine for me, but it might need to be improved for more complex 
cases.
Right now, the most complex handled case is simething like :
<String,byte[]>

So, here is the ant task :

<target name="remove-generics" depends="init">
        <!-- Since XDoclet isn't already able to parse java 1.5 source code,
                we remove all references to generics and for each loops. -->
        <property name="generics.match.pattern" 
value="&lt;[\w\[\]]+(&lt;\w+&gt;)?,?[\w\[\]]*(&lt;\w+&gt;)?&gt;|(for\s?\(.+:.+\))"/>
        <echo message="Pattern used to remove generics : ${generics.match.pattern}"/>
        <copy toDir="${build.generate.dir}/java" overwrite="true">
                <fileset dir="${src.main.dir}">
                        <include name="**/*.java"/>
                </fileset>
        </copy>
        <replaceregexp byline="true" flags="g">
                <fileset dir="${build.generate.dir}/java">
                        <include name="**/*.java"/>
                </fileset>
                <regexp pattern="${generics.match.pattern}"/>
                <substitution expression=""/>
        </replaceregexp>
</target>
---------------------------------------------------------------------
View this comment:
  
http://opensource.atlassian.com/projects/xdoclet/browse/XJD-41?page=comments#action_15013

---------------------------------------------------------------------
View the issue:
  http://opensource.atlassian.com/projects/xdoclet/browse/XJD-41

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: XJD-41
    Summary: Support Java 1.5 Syntax ?
       Type: Improvement

     Status: Open
   Priority: Major

 Original Estimate: Unknown
 Time Spent: Unknown
  Remaining: Unknown

    Project: XJavaDoc
 Components: 
             Parser
   Versions:
             1.0.2

   Assignee: xdoclet-devel (Use for new issues)
   Reporter: Hao Chen

    Created: Mon, 1 Mar 2004 9:11 AM
    Updated: Sun, 3 Oct 2004 8:38 AM

Description:
Is there any plan to upgrade the parser to support Java 1.5 syntax?


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://opensource.atlassian.com/projects/xdoclet/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to