maven-m2-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject cvs commit: maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor Parameter.java PluginDescriptorBuilder.java
Date Tue, 28 Dec 2004 20:04:27 GMT
jvanzyl     2004/12/28 12:04:27

  Modified:    maven-plugin/src/main/java/org/apache/maven/plugin/descriptor
                        Parameter.java PluginDescriptorBuilder.java
  Log:
  allow default values for parameters
  
  Revision  Changes    Path
  1.2       +13 -1     maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java
  
  Index: Parameter.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/Parameter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Parameter.java	9 Aug 2004 18:49:36 -0000	1.1
  +++ Parameter.java	28 Dec 2004 20:04:27 -0000	1.2
  @@ -34,6 +34,8 @@
   
       private String expression;
   
  +    private String defaultValue;
  +
       // ----------------------------------------------------------------------
       //
       // ----------------------------------------------------------------------
  @@ -96,5 +98,15 @@
       public void setExpression( String expression )
       {
           this.expression = expression;
  +    }
  +
  +    public String getDefaultValue()
  +    {
  +        return defaultValue;
  +    }
  +
  +    public void setDefaultValue( String defaultValue )
  +    {
  +        this.defaultValue = defaultValue;
       }
   }
  
  
  
  1.4       +11 -11    maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java
  
  Index: PluginDescriptorBuilder.java
  ===================================================================
  RCS file: /home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/descriptor/PluginDescriptorBuilder.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PluginDescriptorBuilder.java	24 Oct 2004 18:20:37 -0000	1.3
  +++ PluginDescriptorBuilder.java	28 Dec 2004 20:04:27 -0000	1.4
  @@ -12,8 +12,6 @@
   /**
    * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
    * @version $Id$
  - * @todo these are all really tools for dealing with xml configurations so they
  - * should be packaged as such.
    */
   public class PluginDescriptorBuilder
   {
  @@ -105,26 +103,28 @@
           {
               PlexusConfiguration d = parameterConfigurations[i];
   
  -            Parameter cd = new Parameter();
  +            Parameter parameter = new Parameter();
   
  -            cd.setName( d.getChild( "name" ).getValue() );
  +            parameter.setName( d.getChild( "name" ).getValue() );
   
  -            cd.setType( d.getChild( "type" ).getValue() );
  +            parameter.setType( d.getChild( "type" ).getValue() );
   
               String s = c.getChild( "required" ).getValue();
   
               if ( s != null )
               {
  -                cd.setRequired( s.equals( "true" ) ? true : false );
  +                parameter.setRequired( s.equals( "true" ) ? true : false );
               }
   
  -            cd.setValidator( d.getChild( "validator" ).getValue() );
  +            parameter.setValidator( d.getChild( "validator" ).getValue() );
  +
  +            parameter.setDescription( d.getChild( "description" ).getValue() );
   
  -            cd.setDescription( d.getChild( "description" ).getValue() );
  +            parameter.setExpression( d.getChild( "expression" ).getValue() );
   
  -            cd.setExpression( d.getChild( "expression" ).getValue() );
  +            parameter.setDefaultValue( d.getChild( "default" ).getValue() );
   
  -            parameters.add( cd );
  +            parameters.add( parameter );
           }
   
           mojo.setParameters( parameters );
  
  
  

Mime
View raw message