org.apache.maven.model.converter.relocators
Class AbstractPluginRelocator

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.model.converter.relocators.AbstractPluginRelocator
All Implemented Interfaces:
PluginRelocator, org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
AbstractSourceForgePluginRelocator, DeveloperActivityPluginRelocator, FaqPluginRelocator, FileActivityPluginRelocator, JavaCCPluginRelocator, JdependPluginRelocator, JdiffPluginRelocator, JunitReportPluginRelocator, LicenseRelocator, SimianPluginRelocator, TasklistPluginRelocator, XdocPluginRelocator

public abstract class AbstractPluginRelocator
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements PluginRelocator

A general implementation of the PluginRelocator interface.

Version:
$Id: AbstractPluginRelocator.java 543493 2007-06-01 14:12:28Z evenisse $
Author:
Dennis Lundberg

Field Summary
private  java.util.List listeners
           
 
Fields inherited from interface org.apache.maven.model.converter.relocators.PluginRelocator
ROLE
 
Constructor Summary
AbstractPluginRelocator()
           
 
Method Summary
 void addListener(ConverterListener listener)
          Add a listener for all messages sended by the relocator.
 void addListeners(java.util.List listeners)
          Add a listeners list for all messages sended by the relocator.
private  void fireRelocatePluginEvent(java.lang.String oldGroupId, java.lang.String oldArtifactId, java.lang.String newGroupId, java.lang.String newArtifactId)
           
private  void fireRelocateReportEvent(java.lang.String oldGroupId, java.lang.String oldArtifactId, java.lang.String newGroupId, java.lang.String newArtifactId)
           
private  void fireRemovePluginEvent(java.lang.String groupId, java.lang.String artifactId)
           
private  void fireRemoveReportEvent(java.lang.String groupId, java.lang.String artifactId)
           
abstract  java.lang.String getNewArtifactId()
          If there is no replacement for this plugin, you can have the plugin removed from the v4 pom by returning null from this method and from getNewGroupId().
abstract  java.lang.String getNewGroupId()
          If there is no replacement for this plugin, you can have the plugin removed from the v4 pom by returning null from this method and from getNewArtifactId().
abstract  java.lang.String getOldArtifactId()
          Note: Because we are working on the recently converted Maven 2 model, this method must return the artifactId that is in the model, after the model has been converted.
 java.lang.String getOldGroupId()
          Note: Because we are working on the recently converted Maven 2 model, this method must return the groupId that is in the model, after the model has been converted.
 void relocate(org.apache.maven.model.Model v4Model)
          Relocate a plugin from one groupId/artifactId to another.
private  void sendInfoMessage(java.lang.String message)
           
 
Methods inherited from class org.codehaus.plexus.logging.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

listeners

private java.util.List listeners
Constructor Detail

AbstractPluginRelocator

public AbstractPluginRelocator()
Method Detail

getNewArtifactId

public abstract java.lang.String getNewArtifactId()
If there is no replacement for this plugin, you can have the plugin removed from the v4 pom by returning null from this method and from getNewGroupId().

Returns:
The artifactId of the new Maven 2 plugin

getNewGroupId

public abstract java.lang.String getNewGroupId()
If there is no replacement for this plugin, you can have the plugin removed from the v4 pom by returning null from this method and from getNewArtifactId().

Returns:
The groupId of the new Maven 2 plugin

getOldArtifactId

public abstract java.lang.String getOldArtifactId()
Note: Because we are working on the recently converted Maven 2 model, this method must return the artifactId that is in the model, after the model has been converted.

Returns:
The artifactId of the Maven 1 plugin.
See Also:
PomV3ToV4Translator.translateDependencies(java.util.List)

getOldGroupId

public java.lang.String getOldGroupId()
Note: Because we are working on the recently converted Maven 2 model, this method must return the groupId that is in the model, after the model has been converted.

Feel free to overload this method if your plugin has a different groupId.

Returns:
The groupId of the Maven 1 plugin.
See Also:
PomV3ToV4Translator.translateDependencies(java.util.List)

relocate

public void relocate(org.apache.maven.model.Model v4Model)
Relocate a plugin from one groupId/artifactId to another.

Specified by:
relocate in interface PluginRelocator
Parameters:
v4Model - The model where we look for the plugin

addListener

public void addListener(ConverterListener listener)
Description copied from interface: PluginRelocator
Add a listener for all messages sended by the relocator.

Specified by:
addListener in interface PluginRelocator
Parameters:
listener - The listener that will receive messages

addListeners

public void addListeners(java.util.List listeners)
Description copied from interface: PluginRelocator
Add a listeners list for all messages sended by the relocator.

Specified by:
addListeners in interface PluginRelocator
Parameters:
listeners - The listeners list that will receive messages

sendInfoMessage

private void sendInfoMessage(java.lang.String message)

fireRelocatePluginEvent

private void fireRelocatePluginEvent(java.lang.String oldGroupId,
                                     java.lang.String oldArtifactId,
                                     java.lang.String newGroupId,
                                     java.lang.String newArtifactId)

fireRelocateReportEvent

private void fireRelocateReportEvent(java.lang.String oldGroupId,
                                     java.lang.String oldArtifactId,
                                     java.lang.String newGroupId,
                                     java.lang.String newArtifactId)

fireRemovePluginEvent

private void fireRemovePluginEvent(java.lang.String groupId,
                                   java.lang.String artifactId)

fireRemoveReportEvent

private void fireRemoveReportEvent(java.lang.String groupId,
                                   java.lang.String artifactId)