Collections.sort( params, new Comparator()
{
/** {@inheritDoc} */
public int compare( Object o1, Object o2 )
{
Parameter parameter1 = (Parameter) o1;
Parameter parameter2 = (Parameter) o2;
return parameter1.getName().compareToIgnoreCase( parameter2.getName() );
}
} );
append( buffer, "Available parameters:", 1 );
// indent 2
for ( Iterator it = params.iterator(); it.hasNext(); )
{
Parameter parameter = (Parameter) it.next();
if ( !parameter.isEditable() )
{
continue;
}
buffer.append( "\n" );
// DGF wouldn't it be nice if this worked?
String defaultVal = parameter.getDefaultValue();
if ( defaultVal == null )
{
// defaultVal is ALWAYS null, this is a bug in PluginDescriptorBuilder
defaultVal =
md.getMojoConfiguration().getChild( parameter.getName() ).getAttribute( "default-value", null );
}
if ( StringUtils.isNotEmpty( defaultVal ) )
{
defaultVal = " (Default: " + defaultVal + ")";
}
else
{
defaultVal = "";
}
append( buffer, parameter.getName() + defaultVal, 2 );
String expression = parameter.getExpression();
if ( StringUtils.isNotEmpty( expression ) )
{
append( buffer, "Expression", expression, 3 );
}
append( buffer, toDescription( parameter.getDescription() ), 3 );
String deprecation = parameter.getDeprecated();
if ( deprecation != null && deprecation.length() <= 0 )
{
deprecation = NO_REASON;
}