improved javadoc

This commit is contained in:
Hervé Boutemy 2012-12-15 21:06:57 +01:00
parent 950b9b3c58
commit a07fdf076c
2 changed files with 56 additions and 46 deletions

View File

@ -52,7 +52,8 @@ import org.apache.maven.model.Scm;
import org.apache.maven.model.Site;
/**
* The domain-specific model merger for the Maven POM.
* The domain-specific model merger for the Maven POM, overriding generic code from parent class when necessary with
* more adapted algorithms.
*
* @author Benjamin Bentmann
*/
@ -631,45 +632,45 @@ public class MavenModelMerger
}
@Override
protected Object getPluginKey( Plugin object )
protected Object getPluginKey( Plugin plugin )
{
return object.getKey();
return plugin.getKey();
}
@Override
protected Object getPluginExecutionKey( PluginExecution object )
protected Object getPluginExecutionKey( PluginExecution pluginExecution )
{
return object.getId();
return pluginExecution.getId();
}
@Override
protected Object getReportPluginKey( ReportPlugin object )
protected Object getReportPluginKey( ReportPlugin reportPlugin )
{
return object.getKey();
return reportPlugin.getKey();
}
@Override
protected Object getReportSetKey( ReportSet object )
protected Object getReportSetKey( ReportSet reportSet )
{
return object.getId();
return reportSet.getId();
}
@Override
protected Object getRepositoryBaseKey( RepositoryBase object )
protected Object getRepositoryBaseKey( RepositoryBase repositoryBase )
{
return object.getId();
return repositoryBase.getId();
}
@Override
protected Object getExtensionKey( Extension object )
protected Object getExtensionKey( Extension extension )
{
return object.getGroupId() + ':' + object.getArtifactId();
return extension.getGroupId() + ':' + extension.getArtifactId();
}
@Override
protected Object getExclusionKey( Exclusion object )
protected Object getExclusionKey( Exclusion exclusion )
{
return object.getGroupId() + ':' + object.getArtifactId();
return exclusion.getGroupId() + ':' + exclusion.getArtifactId();
}
private String appendPath( String parentPath, Map<Object, Object> context )

View File

@ -71,7 +71,16 @@ import org.codehaus.plexus.util.xml.Xpp3Dom;
/**
* This is a hand-crafted prototype of the default model merger that should eventually be generated by Modello by a new
* Java plugin.
* Java plugin. Code structure to merge source (read-only) object into the target object is:<ul>
* <li><code>merge<i>Classname</i>( <i>Classname</i> target, <i>Classname</i> source, boolean sourceDominant,
* Map<Object, Object> context )</code> for each model class</li>
* <li><code>merge<i>Classname</i>_<i>FieldName</i>( <i>Classname</i> target, <i>Classname</i> source, boolean
* sourceDominant, Map<Object, Object> context )</code> for each field of each model class</li>
* <li><code>Object get<i>Classname</i>Key( <i>Classname</i> <i>classname</i> )</code> for each class that is used in a list</li>
* </ul>
* Code is written like it could be generated, with default behaviour to be overridden when necessary.
* This is particularly the case for <code>Object get<i>Classname</i>Key( <i>Classname</i> <i>classname</i> )</code> method,
* which by default return the object itself and is expected to be overridden to calculate better suited key value.
*
* @author Benjamin Bentmann
*/
@ -2834,79 +2843,79 @@ public class ModelMerger
return dependency;
}
protected Object getPluginKey( Plugin object )
protected Object getPluginKey( Plugin plugin )
{
return object;
return plugin;
}
protected Object getPluginExecutionKey( PluginExecution object )
protected Object getPluginExecutionKey( PluginExecution pluginExecution )
{
return object;
return pluginExecution;
}
protected Object getReportPluginKey( ReportPlugin object )
protected Object getReportPluginKey( ReportPlugin reportPlugin )
{
return object;
return reportPlugin;
}
protected Object getReportSetKey( ReportSet object )
protected Object getReportSetKey( ReportSet reportSet )
{
return object;
return reportSet;
}
protected Object getLicenseKey( License object )
protected Object getLicenseKey( License license )
{
return object;
return license;
}
protected Object getMailingListKey( MailingList object )
protected Object getMailingListKey( MailingList mailingList )
{
return object;
return mailingList;
}
protected Object getDeveloperKey( Developer object )
protected Object getDeveloperKey( Developer developer )
{
return object;
return developer;
}
protected Object getContributorKey( Contributor object )
protected Object getContributorKey( Contributor contributor )
{
return object;
return contributor;
}
protected Object getProfileKey( Profile object )
protected Object getProfileKey( Profile profile )
{
return object;
return profile;
}
protected Object getRepositoryKey( Repository object )
protected Object getRepositoryKey( Repository repository )
{
return getRepositoryBaseKey( object );
return getRepositoryBaseKey( repository );
}
protected Object getRepositoryBaseKey( RepositoryBase object )
protected Object getRepositoryBaseKey( RepositoryBase repositoryBase )
{
return object;
return repositoryBase;
}
protected Object getNotifierKey( Notifier object )
protected Object getNotifierKey( Notifier notifier )
{
return object;
return notifier;
}
protected Object getResourceKey( Resource object )
protected Object getResourceKey( Resource resource )
{
return object;
return resource;
}
protected Object getExtensionKey( Extension object )
protected Object getExtensionKey( Extension extension )
{
return object;
return extension;
}
protected Object getExclusionKey( Exclusion object )
protected Object getExclusionKey( Exclusion exclusion )
{
return object;
return exclusion;
}
}