jvanzyl 2004/05/26 23:57:28
Modified: maven-plugin/src/main/java/org/apache/maven/plugin/generator
BeanGenerator.java
Log:
o albeit simple, the first m2 plugin to execute under m1 with artifacts
entirely generated from @tags in the m2 plugin source.
__ __
| \/ |__ _Apache__ ___
| |\/| / _ \ V / -_) ' \ ~ intelligent projects ~
|_| |_\__,_|\_/\___|_||_| v. 1.0-rc2
Attempting to download maven-plugin-2.0-SNAPSHOT.jar.
Deleting directory
/home/jvanzyl/js/org.codehaus/mojo/maven-geronimo-plugin/target/world/app/modules/ejb/target
BUILD SUCCESSFUL
Total time: 3 seconds
Finished at: Thu May 27 02:48:54 EDT 2004
Revision Changes Path
1.3 +7 -3
maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator/BeanGenerator.java
Index: BeanGenerator.java
===================================================================
RCS file:
/home/cvs/maven-components/maven-plugin/src/main/java/org/apache/maven/plugin/generator/BeanGenerator.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BeanGenerator.java 27 May 2004 01:58:26 -0000 1.2
+++ BeanGenerator.java 27 May 2004 06:57:28 -0000 1.3
@@ -35,6 +35,8 @@
jClass.setSuperClass( "org.apache.maven.plugin.BeanPluginAdapter" );
+ jClass.addImport( "java.util.*" );
+
// ----------------------------------------------------------------------
// Use the same package as the plugin we are wrapping.
// ----------------------------------------------------------------------
@@ -63,7 +65,7 @@
{
Parameter parameter = (Parameter) parameters.get( i );
- jClass.addMethod( createSetter( parameter ) );
+ jClass.addMethod( createSetter( parameter, jClass ) );
}
// ----------------------------------------------------------------------
@@ -90,7 +92,7 @@
writer.close();
}
- private JMethod createSetter( Parameter parameter )
+ private JMethod createSetter( Parameter parameter, JClass jClass )
{
String propertyName = capitalise( parameter.getName() );
@@ -104,7 +106,9 @@
if ( arrayLocation > 0 )
{
- parameterType = new JClass( type.substring( 0, arrayLocation )
).createArray();
+ type = type.substring( 0, arrayLocation );
+
+ parameterType = new JClass( type ).createArray();
}
else
{
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]