[MPLUGIN-199] removed old undocumented "property" feature of javadoc tags (ie changing field name)

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1340565 13f79535-47bb-0310-9956-ffa450edef68
master
Herve Boutemy 2012-05-19 20:57:43 +00:00
parent 3a52298a04
commit 0a1066ff87
2 changed files with 3 additions and 39 deletions

View File

@ -309,19 +309,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).

View File

@ -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 );