You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2012/05/19 22:57:44 UTC

svn commit: r1340565 - in /maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java: JavaMojoAnnotation.java JavaMojoDescriptorExtractor.java

Author: hboutemy
Date: Sat May 19 20:57:43 2012
New Revision: 1340565

URL: http://svn.apache.org/viewvc?rev=1340565&view=rev
Log:
[MPLUGIN-199] removed old undocumented "property" feature of javadoc tags (ie changing field name)

Modified:
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java
    maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java

Modified: maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java?rev=1340565&r1=1340564&r2=1340565&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoAnnotation.java Sat May 19 20:57:43 2012
@@ -310,19 +310,6 @@ public interface JavaMojoAnnotation
     String PARAMETER_IMPLEMENTATION = "implementation";
 
     /**
-     * This indicates the base name of the bean properties used to read/write this parameter's value.
-     * <br/>
-     * Refer to <code>&#64;parameter property="project"</code>
-     * <p/>
-     * Would say there is a getProject() method and a setProject(Project) method. Here the field
-     * name would not be the basis for the parameter's name. This mode of operation will allow the
-     * mojos to be usable as beans and will be the promoted form of use.
-     * <br/>
-     * <b>Note</b>: Should be defined in a Mojo Field.
-     */
-    String PARAMETER_PROPERTY = "property";
-
-    /**
      * Specifies that this parameter cannot be configured directly by the user (as in the case of POM-specified
      * configuration).
      * <br/>

Modified: maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java
URL: http://svn.apache.org/viewvc/maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java?rev=1340565&r1=1340564&r2=1340565&view=diff
==============================================================================
--- maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java (original)
+++ maven/plugin-tools/trunk/maven-plugin-tools-java/src/main/java/org/apache/maven/tools/plugin/extractor/java/JavaMojoDescriptorExtractor.java Sat May 19 20:57:43 2012
@@ -89,9 +89,6 @@ public class JavaMojoDescriptorExtractor
     /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_IMPLEMENTATION} instead of. */
     public static final String PARAMETER_IMPLEMENTATION = JavaMojoAnnotation.PARAMETER_IMPLEMENTATION;
 
-    /** @deprecated since 2.4, use {@link JavaMojoAnnotation#PARAMETER_PROPERTY} instead of. */
-    public static final String PARAMETER_PROPERTY = JavaMojoAnnotation.PARAMETER_PROPERTY;
-
     /** @deprecated since 2.4, use {@link JavaMojoAnnotation#REQUIRED} instead of. */
     public static final String REQUIRED = JavaMojoAnnotation.REQUIRED;
 
@@ -475,6 +472,8 @@ public class JavaMojoDescriptorExtractor
 
             Parameter pd = new Parameter();
 
+            pd.setName( entry.getKey() );
+
             if ( !type.isArray() )
             {
                 pd.setType( type.getValue() );
@@ -496,6 +495,7 @@ public class JavaMojoDescriptorExtractor
             pd.setDescription( field.getComment() );
 
             DocletTag componentTag = field.getTagByName( JavaMojoAnnotation.COMPONENT );
+
             if ( componentTag != null )
             {
                 String role = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLE );
@@ -515,8 +515,6 @@ public class JavaMojoDescriptorExtractor
 
                 pd.setRequirement( new Requirement( role, roleHint ) );
 
-                pd.setName( entry.getKey() );
-
                 pd.setEditable( false );
                 /* TODO: or better like this? Need @component fields be editable for the user?
                 pd.setEditable( field.getTagByName( READONLY ) == null );
@@ -526,27 +524,6 @@ public class JavaMojoDescriptorExtractor
             {
                 DocletTag parameter = field.getTagByName( JavaMojoAnnotation.PARAMETER );
 
-                // ----------------------------------------------------------------------
-                // We will look for a property name here first and use that if present
-                // i.e:
-                //
-                // @parameter property="project"
-                //
-                // Which will become the name used for the configuration element which
-                // will in turn will allow plexus to use the corresponding setter.
-                // ----------------------------------------------------------------------
-
-                String property = parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_PROPERTY );
-
-                if ( !StringUtils.isEmpty( property ) )
-                {
-                    pd.setName( property );
-                }
-                else
-                {
-                    pd.setName( entry.getKey() );
-                }
-
                 pd.setRequired( field.getTagByName( JavaMojoAnnotation.REQUIRED ) != null );
 
                 pd.setEditable( field.getTagByName( JavaMojoAnnotation.READONLY ) == null );