restore required and readonly attributes in @Component (not sure the need of that :-) ) maybe future use in core.

git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1337639 13f79535-47bb-0310-9956-ffa450edef68
master
Olivier Lamy 2012-05-12 20:37:35 +00:00
parent 98cebd50b7
commit ca84ee10df
3 changed files with 31 additions and 0 deletions

View File

@ -39,4 +39,8 @@ public @interface Component
String role() default "";
String roleHint() default "";
boolean required() default false;
boolean readonly() default false;
}

View File

@ -516,6 +516,9 @@ public class JavaAnnotationsMojoDescriptorExtractor
parameter.setEditable( false );
parameter.setDeprecated( componentAnnotationContent.getDeprecated() );
parameter.setSince( componentAnnotationContent.getSince() );
// same behaviour as JavaMojoDescriptorExtractor
//parameter.setRequired( componentAnnotationContent.required() );
parameter.setEditable( false );
mojoDescriptor.addParameter( parameter );
}

View File

@ -35,6 +35,10 @@ public class ComponentAnnotationContent
private String roleHint;
private boolean required = false;
private boolean readonly = false;
public ComponentAnnotationContent( String fieldName )
{
super( fieldName );
@ -72,6 +76,26 @@ public class ComponentAnnotationContent
return null;
}
public boolean required()
{
return required;
}
public void required( boolean required )
{
this.required = required;
}
public boolean readonly()
{
return readonly;
}
public void readonly( boolean readonly )
{
this.readonly = readonly;
}
@Override
public String toString()
{