code simplification
git-svn-id: https://svn.apache.org/repos/asf/maven/plugin-tools/trunk@1342928 13f79535-47bb-0310-9956-ffa450edef68master
parent
a50582836c
commit
46532f2300
|
|
@ -113,6 +113,11 @@ public final class GeneratorUtils
|
||||||
w.endElement();
|
w.endElement();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void element( XMLWriter w, String name, String value, boolean asText )
|
||||||
|
{
|
||||||
|
element( w, name, asText ? GeneratorUtils.toText( value ) : value );
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param dependencies not null list of <code>Dependency</code>
|
* @param dependencies not null list of <code>Dependency</code>
|
||||||
* @return list of component dependencies
|
* @return list of component dependencies
|
||||||
|
|
|
||||||
|
|
@ -146,14 +146,8 @@ public class PluginDescriptorGenerator
|
||||||
w.startElement( "plugin" );
|
w.startElement( "plugin" );
|
||||||
|
|
||||||
GeneratorUtils.element( w, "name", pluginDescriptor.getName() );
|
GeneratorUtils.element( w, "name", pluginDescriptor.getName() );
|
||||||
if ( helpDescriptor )
|
|
||||||
{
|
GeneratorUtils.element( w, "description", pluginDescriptor.getDescription(), helpDescriptor );
|
||||||
GeneratorUtils.element( w, "description", GeneratorUtils.toText( pluginDescriptor.getDescription() ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GeneratorUtils.element( w, "description", pluginDescriptor.getDescription() );
|
|
||||||
}
|
|
||||||
|
|
||||||
GeneratorUtils.element( w, "groupId", pluginDescriptor.getGroupId() );
|
GeneratorUtils.element( w, "groupId", pluginDescriptor.getGroupId() );
|
||||||
|
|
||||||
|
|
@ -475,17 +469,11 @@ public class PluginDescriptorGenerator
|
||||||
GeneratorUtils.element( w, "required", Boolean.toString( parameter.isRequired() ) );
|
GeneratorUtils.element( w, "required", Boolean.toString( parameter.isRequired() ) );
|
||||||
|
|
||||||
GeneratorUtils.element( w, "editable", Boolean.toString( parameter.isEditable() ) );
|
GeneratorUtils.element( w, "editable", Boolean.toString( parameter.isEditable() ) );
|
||||||
if ( helpDescriptor )
|
|
||||||
{
|
|
||||||
GeneratorUtils.element( w, "description", GeneratorUtils.toText( parameter.getDescription() ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
GeneratorUtils.element( w, "description", parameter.getDescription() );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( StringUtils.isNotEmpty( parameter.getDefaultValue() ) || StringUtils.isNotEmpty(
|
GeneratorUtils.element( w, "description", parameter.getDescription(), helpDescriptor );
|
||||||
parameter.getExpression() ) )
|
|
||||||
|
if ( StringUtils.isNotEmpty( parameter.getDefaultValue() )
|
||||||
|
|| StringUtils.isNotEmpty( parameter.getExpression() ) )
|
||||||
{
|
{
|
||||||
configuration.add( parameter );
|
configuration.add( parameter );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue