Commits

Anonymous committed 3ed1cc4

Moving the apt classes out of range of the compiler until their apt dependency is figured out
XW-435

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1188e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 750b4ea

Comments (0)

Files changed (10)

File src/java/com/opensymphony/xwork2/apt/AbstractProcessor.java

-/*
- * Copyright (c) 2002-2006 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.xwork2.apt;
-
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.Filer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-
-/**
- * <code>AbstractProcessor</code>
- *
- * @author Rainer Hermanns
- * @version $Id$
- */
-public abstract class AbstractProcessor implements AnnotationProcessor {
-
-    protected Log log = null;
-
-    protected AnnotationProcessorEnvironment env;
-
-
-    public AbstractProcessor() {
-        log = LogFactory.getLog(this.getClass());
-    }
-
-
-    /**
-     * Sets the AnnotationProcessorEnvironment.
-     *
-     * @param env the AnnotationProcessorEnvironment.
-     */
-    public void setEnv(AnnotationProcessorEnvironment env) {
-        this.env = env;
-    }
-
-    /**
-     * Initializes all annotations types required for processing.
-     */
-    public void init() {
-    }
-
-    /**
-     * Process all program elements supported by this annotations processor.
-     */
-    public abstract void process();
-
-
-    /**
-     * Returns a PrintWriter that writes to META-INF directory within the Filer.Location.SOURCE_TREE.
-     *
-     * @param filename The filename of the file to be written.
-     * @return PrintWriter that writes to META-INF directory within the Filer.Location.SOURCE_TREE.
-     * @throws IOException
-     */
-    protected PrintWriter getSourceMetaInfWriter(String filename) throws IOException {
-        return env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File("META-INF" + File.separator + filename), "UTF-8");
-    }
-
-    /**
-     * Returns a PrintWriter that writes to META-INF directory within the Filer.Location.CLASS_TREE.
-     *
-     * @param filename The filename of the file to be written.
-     * @return PrintWriter that writes to META-INF directory within the Filer.Location.CLASS_TREE.
-     * @throws IOException
-     */
-    protected PrintWriter getClassesMetaInfWriter(String filename) throws IOException {
-        return env.getFiler().createTextFile(Filer.Location.CLASS_TREE, "", new File("META-INF" + File.separator + filename), "UTF-8");
-    }
-
-    /**
-     * Returns a PrintWriter that writes to WEB-INF directory within the Filer.Location.SOURCE_TREE.
-     *
-     * @param filename The filename of the file to be written.
-     * @return PrintWriter that writes to WEB-INF directory within the Filer.Location.SOURCE_TREE.
-     * @throws IOException
-     */
-    protected PrintWriter getWebInfWriter(String filename) throws IOException {
-        return env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File("WEB-INF" + File.separator + filename), "UTF-8");
-    }
-}

File src/java/com/opensymphony/xwork2/apt/AbstractProcessor.java.bak

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork2.apt;
+
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.Filer;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+/**
+ * <code>AbstractProcessor</code>
+ *
+ * @author Rainer Hermanns
+ * @version $Id$
+ */
+public abstract class AbstractProcessor implements AnnotationProcessor {
+
+    protected Log log = null;
+
+    protected AnnotationProcessorEnvironment env;
+
+
+    public AbstractProcessor() {
+        log = LogFactory.getLog(this.getClass());
+    }
+
+
+    /**
+     * Sets the AnnotationProcessorEnvironment.
+     *
+     * @param env the AnnotationProcessorEnvironment.
+     */
+    public void setEnv(AnnotationProcessorEnvironment env) {
+        this.env = env;
+    }
+
+    /**
+     * Initializes all annotations types required for processing.
+     */
+    public void init() {
+    }
+
+    /**
+     * Process all program elements supported by this annotations processor.
+     */
+    public abstract void process();
+
+
+    /**
+     * Returns a PrintWriter that writes to META-INF directory within the Filer.Location.SOURCE_TREE.
+     *
+     * @param filename The filename of the file to be written.
+     * @return PrintWriter that writes to META-INF directory within the Filer.Location.SOURCE_TREE.
+     * @throws IOException
+     */
+    protected PrintWriter getSourceMetaInfWriter(String filename) throws IOException {
+        return env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File("META-INF" + File.separator + filename), "UTF-8");
+    }
+
+    /**
+     * Returns a PrintWriter that writes to META-INF directory within the Filer.Location.CLASS_TREE.
+     *
+     * @param filename The filename of the file to be written.
+     * @return PrintWriter that writes to META-INF directory within the Filer.Location.CLASS_TREE.
+     * @throws IOException
+     */
+    protected PrintWriter getClassesMetaInfWriter(String filename) throws IOException {
+        return env.getFiler().createTextFile(Filer.Location.CLASS_TREE, "", new File("META-INF" + File.separator + filename), "UTF-8");
+    }
+
+    /**
+     * Returns a PrintWriter that writes to WEB-INF directory within the Filer.Location.SOURCE_TREE.
+     *
+     * @param filename The filename of the file to be written.
+     * @return PrintWriter that writes to WEB-INF directory within the Filer.Location.SOURCE_TREE.
+     * @throws IOException
+     */
+    protected PrintWriter getWebInfWriter(String filename) throws IOException {
+        return env.getFiler().createTextFile(Filer.Location.SOURCE_TREE, "", new File("WEB-INF" + File.separator + filename), "UTF-8");
+    }
+}

File src/java/com/opensymphony/xwork2/apt/ConversionGenerator.java

-/*
- * Copyright (c) 2002-2006 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.xwork2.apt;
-
-import com.opensymphony.xwork2.conversion.metadata.ConversionDescription;
-import com.sun.mirror.apt.Filer;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.PrintWriter;
-import java.util.List;
-import java.util.Map;
-
-/**
- * <code>ConversionGenerator</code>
- *
- * @author Rainer Hermanns
- * @version $Id$
- */
-public class ConversionGenerator extends Generator {
-
-    Map<String, List<ConversionDescription>> conversionsByType = null;
-
-    public ConversionGenerator(Map<String, List<ConversionDescription>> conversionsByType) {
-        this.conversionsByType = conversionsByType;
-
-    }
-
-    /**
-     * Generate the configuration file.
-     * Concrete implementations must override this method.
-     */
-    public void generate(Filer filer) {
-        if (conversionsByType == null) {
-            return;
-        }
-
-        // write property files
-        for (Map.Entry<String, List<ConversionDescription>> descriptionMapping : conversionsByType.entrySet()) {
-
-            String key = descriptionMapping.getKey();
-            String fileName;
-            if (key.equals("")) {
-                fileName = "xwork-conversion.properties";
-            } else {
-                fileName = key.replace('.', File.separatorChar) + "-conversion.properties";
-
-            }
-            final PrintWriter writer;
-            try {
-                writer = filer.createTextFile(Filer.Location.SOURCE_TREE, "", new File(fileName), null);
-                writer.println("# Generated automatically. Do not edit!");
-
-                for (ConversionDescription component : descriptionMapping.getValue()) {
-                    writer.println(component.asProperty());
-                }
-                writer.flush();
-                writer.close();
-
-            } catch (IOException ioe) {
-                throw new RuntimeException("could not generate conversion.properties: " + ioe, ioe);
-            }
-        }
-    }
-}

File src/java/com/opensymphony/xwork2/apt/ConversionGenerator.java.bak

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork2.apt;
+
+import com.opensymphony.xwork2.conversion.metadata.ConversionDescription;
+import com.sun.mirror.apt.Filer;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * <code>ConversionGenerator</code>
+ *
+ * @author Rainer Hermanns
+ * @version $Id$
+ */
+public class ConversionGenerator extends Generator {
+
+    Map<String, List<ConversionDescription>> conversionsByType = null;
+
+    public ConversionGenerator(Map<String, List<ConversionDescription>> conversionsByType) {
+        this.conversionsByType = conversionsByType;
+
+    }
+
+    /**
+     * Generate the configuration file.
+     * Concrete implementations must override this method.
+     */
+    public void generate(Filer filer) {
+        if (conversionsByType == null) {
+            return;
+        }
+
+        // write property files
+        for (Map.Entry<String, List<ConversionDescription>> descriptionMapping : conversionsByType.entrySet()) {
+
+            String key = descriptionMapping.getKey();
+            String fileName;
+            if (key.equals("")) {
+                fileName = "xwork-conversion.properties";
+            } else {
+                fileName = key.replace('.', File.separatorChar) + "-conversion.properties";
+
+            }
+            final PrintWriter writer;
+            try {
+                writer = filer.createTextFile(Filer.Location.SOURCE_TREE, "", new File(fileName), null);
+                writer.println("# Generated automatically. Do not edit!");
+
+                for (ConversionDescription component : descriptionMapping.getValue()) {
+                    writer.println(component.asProperty());
+                }
+                writer.flush();
+                writer.close();
+
+            } catch (IOException ioe) {
+                throw new RuntimeException("could not generate conversion.properties: " + ioe, ioe);
+            }
+        }
+    }
+}

File src/java/com/opensymphony/xwork2/apt/ConversionProcessor.java

-/*
- * Copyright (c) 2002-2006 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.xwork2.apt;
-
-import com.opensymphony.xwork2.conversion.annotations.Conversion;
-import com.opensymphony.xwork2.conversion.annotations.ConversionType;
-import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
-import com.opensymphony.xwork2.conversion.metadata.ConversionDescription;
-import com.opensymphony.xwork2.util.AnnotationUtils;
-import com.sun.mirror.declaration.*;
-import com.sun.mirror.type.ClassType;
-import com.sun.mirror.type.InterfaceType;
-
-import java.util.*;
-
-/**
- * <code>ConversionProcessor</code>
- *
- * @author Rainer Hermanns
- * @version $Id$
- */
-public class ConversionProcessor extends AbstractProcessor {
-
-    private AnnotationTypeDeclaration conversionAnnotation;
-    private AnnotationTypeDeclaration typeConversionAnnotation;
-
-    /**
-     * Initializes all annotations types required for processing.
-     */
-    public void init() {
-        super.init();
-        this.conversionAnnotation = (AnnotationTypeDeclaration) env.getTypeDeclaration(Conversion.class.getName());
-        this.typeConversionAnnotation = (AnnotationTypeDeclaration) env.getTypeDeclaration(TypeConversion.class.getName());
-    }
-
-
-    /**
-     * Process all program elements supported by this annotations processor.
-     */
-    public void process() {
-
-        final Map<String, List<ConversionDescription>> conversionsByType = new Hashtable<String, List<ConversionDescription>>();
-
-        for (Declaration compDecl : env.getDeclarationsAnnotatedWith(conversionAnnotation)) {
-
-            /*
-            * Get all fields with TypeConversion-Annotation of component
-            */
-            List<ConversionDescription> applicationFields = new ArrayList<ConversionDescription>();
-            List<ConversionDescription> classFields = new ArrayList<ConversionDescription>();
-
-            if ( compDecl instanceof InterfaceDeclaration) {
-
-                final InterfaceDeclaration component = (InterfaceDeclaration) compDecl;
-
-                addConversionFields(component, applicationFields, classFields);
-
-                conversionsByType.put("", applicationFields);
-                conversionsByType.put(component.getQualifiedName(), classFields);
-            } else if ( compDecl instanceof ClassDeclaration) {
-                final ClassDeclaration component = (ClassDeclaration) compDecl;
-
-                addConversionFields(component, applicationFields, classFields);
-
-                conversionsByType.put("", applicationFields);
-                conversionsByType.put(component.getQualifiedName(), classFields);
-
-            }
-
-        }
-
-        /**
-         * Holds all components without usage (="default usage")
-         */
-        List<ConversionDescription> defaultDescriptions = conversionsByType.get("");
-
-        // Add components with default usage to specific components
-        /*
-        for (Map.Entry<String, List<ConversionDescription>> descriptionMapping : conversionsByType.entrySet()) {
-            if (!"".equals(descriptionMapping.getKey())) {
-                addDefaultConversions(defaultDescriptions, descriptionMapping.getValue());
-            }
-        }
-        */
-
-        new ConversionGenerator(conversionsByType).generate(env.getFiler());
-    }
-
-    private void addDefaultConversions(List<ConversionDescription> defaultComponents, List<ConversionDescription> specialComponents) {
-        for (ConversionDescription description : defaultComponents) {
-            if (!specialComponents.contains(description)) {
-                specialComponents.add(description);
-            }
-        }
-    }
-
-    private ConversionDescription createConversionDescription(MethodDeclaration method, AnnotationMirror annotation) {
-
-        Map<AnnotationTypeElementDeclaration, AnnotationValue> values = annotation.getElementValues();
-
-        final ConversionDescription result;
-
-        String property = AnnotationUtils.resolvePropertyName(method);
-
-        if (typeConversionAnnotation.equals(annotation.getAnnotationType().getDeclaration())) {
-
-
-            result = new ConversionDescription(property);
-
-            for (AnnotationTypeElementDeclaration element : typeConversionAnnotation.getMethods()) {
-                AnnotationValue value = values.get(element);
-                if (value == null) {
-                    value = element.getDefaultValue();
-                }
-
-                String name = element.getSimpleName();
-                if ("rule".equals(name)) {
-                    result.setRule(value.getValue().toString());
-                } else if ("converter".equals(name)) {
-                    result.setTypeConverter(value.getValue().toString());
-                } else if ("message".equals(name)) {
-                    result.setValue(value.getValue().toString());
-                } else if ("key".equals(name)) {
-                    String s = value.getValue().toString();
-                    if ( s != null && s.length() > 0 ) {
-                        result.setProperty(s);
-                    }
-                } else if ("type".equals(name)) {
-                    result.setType(value.getValue().toString());
-                }
-            }
-            return result;
-        }
-        return null;
-    }
-
-    /**
-     * Adds all fields with TypeConversion Annotation of class clazz and
-     * its superclasses to allFields
-     */
-    private void addConversionFields(ClassDeclaration clazz, List<ConversionDescription> allApplicationFields, List<ConversionDescription> allClassFields) {
-        if (clazz == null) {
-            return;
-        }
-
-        processConversionFields(clazz, allApplicationFields, allClassFields);
-
-        ClassType superClazz = clazz.getSuperclass();
-        if (superClazz != null) {
-            addConversionFields(superClazz.getDeclaration(), allApplicationFields, allClassFields);
-        }
-    }
-
-    /**
-     * Adds all fields with TypeConversion Annotation of class clazz and
-     * its superclasses to allFields
-     */
-    private void addConversionFields(InterfaceDeclaration clazz, List<ConversionDescription> allApplicationFields, List<ConversionDescription> allClassFields) {
-        if (clazz == null) {
-            return;
-        }
-
-        processConversionFields(clazz, allApplicationFields, allClassFields);
-        Collection<InterfaceType> ifaces = clazz.getSuperinterfaces();
-
-        if ( ifaces != null ) {
-            for ( InterfaceType it : ifaces) {
-                addConversionFields(it.getDeclaration(), allApplicationFields, allClassFields);
-            }
-        }
-    }
-
-    private void processConversionFields(TypeDeclaration clazz, List<ConversionDescription> allApplicationFields, List<ConversionDescription> allClassFields) {
-        Collection<? extends MethodDeclaration> methods = clazz.getMethods();
-
-        for (MethodDeclaration method : methods) {
-
-            Collection<AnnotationMirror> annos = method.getAnnotationMirrors();
-            for (AnnotationMirror am : annos) {
-
-                Map<AnnotationTypeElementDeclaration, AnnotationValue> values = am.getElementValues();
-                for ( AnnotationTypeElementDeclaration element : typeConversionAnnotation.getMethods()) {
-                    AnnotationValue value = values.get(element);
-                    if (value == null) {
-                        value = element.getDefaultValue();
-                    }
-                    if ( "type".equals(element.getSimpleName()) ) {
-                        ConversionDescription desc = createConversionDescription(method, am);
-                        if ( desc != null ) {
-                            if ( value.getValue().toString().equals(ConversionType.APPLICATION.toString())) {
-                                allApplicationFields.add(desc);
-                            } else {
-                                allClassFields.add(desc);
-                            }
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-    }
-}

File src/java/com/opensymphony/xwork2/apt/ConversionProcessor.java.bak

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork2.apt;
+
+import com.opensymphony.xwork2.conversion.annotations.Conversion;
+import com.opensymphony.xwork2.conversion.annotations.ConversionType;
+import com.opensymphony.xwork2.conversion.annotations.TypeConversion;
+import com.opensymphony.xwork2.conversion.metadata.ConversionDescription;
+import com.opensymphony.xwork2.util.AnnotationUtils;
+import com.sun.mirror.declaration.*;
+import com.sun.mirror.type.ClassType;
+import com.sun.mirror.type.InterfaceType;
+
+import java.util.*;
+
+/**
+ * <code>ConversionProcessor</code>
+ *
+ * @author Rainer Hermanns
+ * @version $Id$
+ */
+public class ConversionProcessor extends AbstractProcessor {
+
+    private AnnotationTypeDeclaration conversionAnnotation;
+    private AnnotationTypeDeclaration typeConversionAnnotation;
+
+    /**
+     * Initializes all annotations types required for processing.
+     */
+    public void init() {
+        super.init();
+        this.conversionAnnotation = (AnnotationTypeDeclaration) env.getTypeDeclaration(Conversion.class.getName());
+        this.typeConversionAnnotation = (AnnotationTypeDeclaration) env.getTypeDeclaration(TypeConversion.class.getName());
+    }
+
+
+    /**
+     * Process all program elements supported by this annotations processor.
+     */
+    public void process() {
+
+        final Map<String, List<ConversionDescription>> conversionsByType = new Hashtable<String, List<ConversionDescription>>();
+
+        for (Declaration compDecl : env.getDeclarationsAnnotatedWith(conversionAnnotation)) {
+
+            /*
+            * Get all fields with TypeConversion-Annotation of component
+            */
+            List<ConversionDescription> applicationFields = new ArrayList<ConversionDescription>();
+            List<ConversionDescription> classFields = new ArrayList<ConversionDescription>();
+
+            if ( compDecl instanceof InterfaceDeclaration) {
+
+                final InterfaceDeclaration component = (InterfaceDeclaration) compDecl;
+
+                addConversionFields(component, applicationFields, classFields);
+
+                conversionsByType.put("", applicationFields);
+                conversionsByType.put(component.getQualifiedName(), classFields);
+            } else if ( compDecl instanceof ClassDeclaration) {
+                final ClassDeclaration component = (ClassDeclaration) compDecl;
+
+                addConversionFields(component, applicationFields, classFields);
+
+                conversionsByType.put("", applicationFields);
+                conversionsByType.put(component.getQualifiedName(), classFields);
+
+            }
+
+        }
+
+        /**
+         * Holds all components without usage (="default usage")
+         */
+        List<ConversionDescription> defaultDescriptions = conversionsByType.get("");
+
+        // Add components with default usage to specific components
+        /*
+        for (Map.Entry<String, List<ConversionDescription>> descriptionMapping : conversionsByType.entrySet()) {
+            if (!"".equals(descriptionMapping.getKey())) {
+                addDefaultConversions(defaultDescriptions, descriptionMapping.getValue());
+            }
+        }
+        */
+
+        new ConversionGenerator(conversionsByType).generate(env.getFiler());
+    }
+
+    private void addDefaultConversions(List<ConversionDescription> defaultComponents, List<ConversionDescription> specialComponents) {
+        for (ConversionDescription description : defaultComponents) {
+            if (!specialComponents.contains(description)) {
+                specialComponents.add(description);
+            }
+        }
+    }
+
+    private ConversionDescription createConversionDescription(MethodDeclaration method, AnnotationMirror annotation) {
+
+        Map<AnnotationTypeElementDeclaration, AnnotationValue> values = annotation.getElementValues();
+
+        final ConversionDescription result;
+
+        String property = AnnotationUtils.resolvePropertyName(method);
+
+        if (typeConversionAnnotation.equals(annotation.getAnnotationType().getDeclaration())) {
+
+
+            result = new ConversionDescription(property);
+
+            for (AnnotationTypeElementDeclaration element : typeConversionAnnotation.getMethods()) {
+                AnnotationValue value = values.get(element);
+                if (value == null) {
+                    value = element.getDefaultValue();
+                }
+
+                String name = element.getSimpleName();
+                if ("rule".equals(name)) {
+                    result.setRule(value.getValue().toString());
+                } else if ("converter".equals(name)) {
+                    result.setTypeConverter(value.getValue().toString());
+                } else if ("message".equals(name)) {
+                    result.setValue(value.getValue().toString());
+                } else if ("key".equals(name)) {
+                    String s = value.getValue().toString();
+                    if ( s != null && s.length() > 0 ) {
+                        result.setProperty(s);
+                    }
+                } else if ("type".equals(name)) {
+                    result.setType(value.getValue().toString());
+                }
+            }
+            return result;
+        }
+        return null;
+    }
+
+    /**
+     * Adds all fields with TypeConversion Annotation of class clazz and
+     * its superclasses to allFields
+     */
+    private void addConversionFields(ClassDeclaration clazz, List<ConversionDescription> allApplicationFields, List<ConversionDescription> allClassFields) {
+        if (clazz == null) {
+            return;
+        }
+
+        processConversionFields(clazz, allApplicationFields, allClassFields);
+
+        ClassType superClazz = clazz.getSuperclass();
+        if (superClazz != null) {
+            addConversionFields(superClazz.getDeclaration(), allApplicationFields, allClassFields);
+        }
+    }
+
+    /**
+     * Adds all fields with TypeConversion Annotation of class clazz and
+     * its superclasses to allFields
+     */
+    private void addConversionFields(InterfaceDeclaration clazz, List<ConversionDescription> allApplicationFields, List<ConversionDescription> allClassFields) {
+        if (clazz == null) {
+            return;
+        }
+
+        processConversionFields(clazz, allApplicationFields, allClassFields);
+        Collection<InterfaceType> ifaces = clazz.getSuperinterfaces();
+
+        if ( ifaces != null ) {
+            for ( InterfaceType it : ifaces) {
+                addConversionFields(it.getDeclaration(), allApplicationFields, allClassFields);
+            }
+        }
+    }
+
+    private void processConversionFields(TypeDeclaration clazz, List<ConversionDescription> allApplicationFields, List<ConversionDescription> allClassFields) {
+        Collection<? extends MethodDeclaration> methods = clazz.getMethods();
+
+        for (MethodDeclaration method : methods) {
+
+            Collection<AnnotationMirror> annos = method.getAnnotationMirrors();
+            for (AnnotationMirror am : annos) {
+
+                Map<AnnotationTypeElementDeclaration, AnnotationValue> values = am.getElementValues();
+                for ( AnnotationTypeElementDeclaration element : typeConversionAnnotation.getMethods()) {
+                    AnnotationValue value = values.get(element);
+                    if (value == null) {
+                        value = element.getDefaultValue();
+                    }
+                    if ( "type".equals(element.getSimpleName()) ) {
+                        ConversionDescription desc = createConversionDescription(method, am);
+                        if ( desc != null ) {
+                            if ( value.getValue().toString().equals(ConversionType.APPLICATION.toString())) {
+                                allApplicationFields.add(desc);
+                            } else {
+                                allClassFields.add(desc);
+                            }
+                            break;
+                        }
+                    }
+                }
+            }
+        }
+    }
+}

File src/java/com/opensymphony/xwork2/apt/Generator.java

-/*
- * Copyright (c) 2002-2006 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.xwork2.apt;
-
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.Filer;
-
-/**
- * <code>Generator</code>
- *
- * @author Rainer Hermanns
- * @version $Id$
- */
-public abstract class Generator {
-
-
-    protected AnnotationProcessorEnvironment env;
-
-
-    /**
-     * Sets the AnnotationProcessorEnvironment.
-     *
-     * @param env the AnnotationProcessorEnvironment.
-     */
-    public void setEnv(AnnotationProcessorEnvironment env) {
-        this.env = env;
-    }
-
-    /**
-     * Generate the configuration file.
-     * Concrete implementations must override this method.
-     */
-    public abstract void generate(Filer filer);
-
-}

File src/java/com/opensymphony/xwork2/apt/Generator.java.bak

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork2.apt;
+
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.Filer;
+
+/**
+ * <code>Generator</code>
+ *
+ * @author Rainer Hermanns
+ * @version $Id$
+ */
+public abstract class Generator {
+
+
+    protected AnnotationProcessorEnvironment env;
+
+
+    /**
+     * Sets the AnnotationProcessorEnvironment.
+     *
+     * @param env the AnnotationProcessorEnvironment.
+     */
+    public void setEnv(AnnotationProcessorEnvironment env) {
+        this.env = env;
+    }
+
+    /**
+     * Generate the configuration file.
+     * Concrete implementations must override this method.
+     */
+    public abstract void generate(Filer filer);
+
+}

File src/java/com/opensymphony/xwork2/apt/XWorkProcessorFactory.java

-/*
- * Copyright (c) 2002-2006 by OpenSymphony
- * All rights reserved.
- */
-package com.opensymphony.xwork2.apt;
-
-import com.opensymphony.xwork2.conversion.annotations.Conversion;
-import com.opensymphony.xwork2.validator.annotations.Validation;
-import com.sun.mirror.apt.AnnotationProcessor;
-import com.sun.mirror.apt.AnnotationProcessorEnvironment;
-import com.sun.mirror.apt.AnnotationProcessorFactory;
-import com.sun.mirror.apt.AnnotationProcessors;
-import com.sun.mirror.declaration.AnnotationTypeDeclaration;
-
-import java.util.*;
-import java.util.prefs.Preferences;
-
-/**
- * <code>XWorkProcessorFactory</code>
- *
- * @author Rainer Hermanns
- * @version $Id$
- */
-public class XWorkProcessorFactory implements AnnotationProcessorFactory {
-
-    private static Preferences preferences = Preferences.userNodeForPackage(XWorkProcessorFactory.class);
-
-
-    /**
-     * Returns the options recognized by this factory or by any of the processors it may create.
-     *
-     * @return the options recognized by this factory or by any of the processors it may create,
-     *         or an empty collection if none.
-     */
-    public Collection<String> supportedOptions() {
-        return Collections.emptySet();
-    }
-
-    /**
-     * Returns the names of the annotations types supported by this factory.
-     *
-     * @return the names of the annotations types supported by this factory.
-     */
-    public Collection<String> supportedAnnotationTypes() {
-        return createCollection(
-                "com.opensymphony.xwork2.conversion.annotations.*" //,
-                //"com.opensymphony.xwork2.validator.annotations.*"
-        );
-    }
-
-
-    /**
-     * Returns an annotations processor for a set of annotations types.
-     *
-     * @param declarations The type declarations for the annotations types to be processed.
-     * @param env          The environment to use during processing.
-     * @return an annotations processor for the given annotations types, or <tt>null</tt>
-     *         if the types are not supported or the processor cannot be created.
-     */
-    public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> declarations, AnnotationProcessorEnvironment env) {
-        List<AnnotationProcessor> processors = new LinkedList<AnnotationProcessor>();
-
-        AnnotationTypeDeclaration conversionType = (AnnotationTypeDeclaration) env.getTypeDeclaration(Conversion.class.getName());
-        //AnnotationTypeDeclaration validationType = (AnnotationTypeDeclaration) env.getTypeDeclaration(Validation.class.getName());
-
-        if (declarations.contains(conversionType)) {
-            ConversionProcessor conversion = new ConversionProcessor();
-
-            conversion.setEnv(env);
-            conversion.init();
-            processors.add(conversion);
-        }
-
-        // TODO: Temporary disabled...
-        /*
-        if (declarations.contains(validationType)) {
-            ValidationProcessor validation = new ValidationProcessor();
-            validation.setEnv(env);
-            validation.init();
-            processors.add(validation);
-        }
-        */
-
-        if (processors.isEmpty()) {
-            return AnnotationProcessors.NO_OP;
-        }
-
-        if (processors.size() == 1) {
-            return processors.get(0);
-        }
-
-        return AnnotationProcessors.getCompositeAnnotationProcessor(processors);
-    }
-
-    public static <T> Collection<T> createCollection(T... args) {
-        return Arrays.asList(args);
-    }
-}

File src/java/com/opensymphony/xwork2/apt/XWorkProcessorFactory.java.bak

+/*
+ * Copyright (c) 2002-2006 by OpenSymphony
+ * All rights reserved.
+ */
+package com.opensymphony.xwork2.apt;
+
+import com.opensymphony.xwork2.conversion.annotations.Conversion;
+import com.opensymphony.xwork2.validator.annotations.Validation;
+import com.sun.mirror.apt.AnnotationProcessor;
+import com.sun.mirror.apt.AnnotationProcessorEnvironment;
+import com.sun.mirror.apt.AnnotationProcessorFactory;
+import com.sun.mirror.apt.AnnotationProcessors;
+import com.sun.mirror.declaration.AnnotationTypeDeclaration;
+
+import java.util.*;
+import java.util.prefs.Preferences;
+
+/**
+ * <code>XWorkProcessorFactory</code>
+ *
+ * @author Rainer Hermanns
+ * @version $Id$
+ */
+public class XWorkProcessorFactory implements AnnotationProcessorFactory {
+
+    private static Preferences preferences = Preferences.userNodeForPackage(XWorkProcessorFactory.class);
+
+
+    /**
+     * Returns the options recognized by this factory or by any of the processors it may create.
+     *
+     * @return the options recognized by this factory or by any of the processors it may create,
+     *         or an empty collection if none.
+     */
+    public Collection<String> supportedOptions() {
+        return Collections.emptySet();
+    }
+
+    /**
+     * Returns the names of the annotations types supported by this factory.
+     *
+     * @return the names of the annotations types supported by this factory.
+     */
+    public Collection<String> supportedAnnotationTypes() {
+        return createCollection(
+                "com.opensymphony.xwork2.conversion.annotations.*" //,
+                //"com.opensymphony.xwork2.validator.annotations.*"
+        );
+    }
+
+
+    /**
+     * Returns an annotations processor for a set of annotations types.
+     *
+     * @param declarations The type declarations for the annotations types to be processed.
+     * @param env          The environment to use during processing.
+     * @return an annotations processor for the given annotations types, or <tt>null</tt>
+     *         if the types are not supported or the processor cannot be created.
+     */
+    public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> declarations, AnnotationProcessorEnvironment env) {
+        List<AnnotationProcessor> processors = new LinkedList<AnnotationProcessor>();
+
+        AnnotationTypeDeclaration conversionType = (AnnotationTypeDeclaration) env.getTypeDeclaration(Conversion.class.getName());
+        //AnnotationTypeDeclaration validationType = (AnnotationTypeDeclaration) env.getTypeDeclaration(Validation.class.getName());
+
+        if (declarations.contains(conversionType)) {
+            ConversionProcessor conversion = new ConversionProcessor();
+
+            conversion.setEnv(env);
+            conversion.init();
+            processors.add(conversion);
+        }
+
+        // TODO: Temporary disabled...
+        /*
+        if (declarations.contains(validationType)) {
+            ValidationProcessor validation = new ValidationProcessor();
+            validation.setEnv(env);
+            validation.init();
+            processors.add(validation);
+        }
+        */
+
+        if (processors.isEmpty()) {
+            return AnnotationProcessors.NO_OP;
+        }
+
+        if (processors.size() == 1) {
+            return processors.get(0);
+        }
+
+        return AnnotationProcessors.getCompositeAnnotationProcessor(processors);
+    }
+
+    public static <T> Collection<T> createCollection(T... args) {
+        return Arrays.asList(args);
+    }
+}