pd.setType( value.toString() );
}
pd.setDescription( field.getComment() );
DocletTag componentTag = field.getTagByName( JavaMojoAnnotation.COMPONENT );
if ( componentTag != null )
{
String role = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLE );
if ( role == null )
{
role = field.getType().toString();
}
String roleHint = componentTag.getNamedParameter( JavaMojoAnnotation.COMPONENT_ROLEHINT );
if ( roleHint == null )
{
// support alternate syntax for better compatibility with the Plexus CDC.
roleHint = componentTag.getNamedParameter( "role-hint" );
}
String expression = PluginUtils.MAVEN_COMPONENTS.get( role );
if ( expression == null )
{
pd.setRequirement( new Requirement( role, roleHint ) );
}
else
{
pd.setDefaultValue( expression );
pd.setImplementation( role );
pd.setType( role );
}
pd.setEditable( false );
/* TODO: or better like this? Need @component fields be editable for the user?
pd.setEditable( field.getTagByName( READONLY ) == null );
*/
}
else
{
DocletTag parameter = field.getTagByName( JavaMojoAnnotation.PARAMETER );
pd.setRequired( field.getTagByName( JavaMojoAnnotation.REQUIRED ) != null );
pd.setEditable( field.getTagByName( JavaMojoAnnotation.READONLY ) == null );
DocletTag deprecationTag = field.getTagByName( JavaMojoAnnotation.DEPRECATED );
if ( deprecationTag != null )
{
pd.setDeprecated( deprecationTag.getValue() );
}
DocletTag sinceTag = field.getTagByName( JavaMojoAnnotation.SINCE );
if ( sinceTag != null )
{
pd.setSince( sinceTag.getValue() );
}
String alias = parameter.getNamedParameter( JavaMojoAnnotation.PARAMETER_ALIAS );
if ( !StringUtils.isEmpty( alias ) )