org.apache.maven.tools.plugin.extractor
Class AbstractScriptedMojoDescriptorExtractor

java.lang.Object
  extended by org.codehaus.plexus.logging.AbstractLogEnabled
      extended by org.apache.maven.tools.plugin.extractor.AbstractScriptedMojoDescriptorExtractor
All Implemented Interfaces:
MojoDescriptorExtractor, org.codehaus.plexus.logging.LogEnabled
Direct Known Subclasses:
AntMojoDescriptorExtractor, BeanshellMojoDescriptorExtractor

public abstract class AbstractScriptedMojoDescriptorExtractor
extends org.codehaus.plexus.logging.AbstractLogEnabled
implements MojoDescriptorExtractor

Version:
$Id: AbstractScriptedMojoDescriptorExtractor.java 746400 2009-02-20 22:42:13Z bentmann $
Author:
jdcasey

Field Summary
 
Fields inherited from interface org.apache.maven.tools.plugin.extractor.MojoDescriptorExtractor
ROLE
 
Constructor Summary
AbstractScriptedMojoDescriptorExtractor()
           
 
Method Summary
protected  void copyScriptsToOutputDirectory(java.util.Map scriptFilesKeyedByBasedir, java.lang.String outputDirectory, PluginToolsRequest request)
           
 java.util.List execute(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
          Execute the mojo extraction.
 java.util.List execute(PluginToolsRequest request)
          Execute the mojo extraction.
protected  java.util.List extractMojoDescriptors(java.util.Map scriptFilesKeyedByBasedir, PluginToolsRequest request)
          Should be implemented in the sub classes.
protected  java.util.List extractMojoDescriptorsFromMetadata(java.util.Map metadataFilesKeyedByBasedir, PluginToolsRequest request)
          Should be implemented in the sub classes.
protected  java.util.Map gatherFilesByBasedir(java.io.File basedir, java.util.List directories, java.lang.String scriptFileExtension, PluginToolsRequest request)
           
protected  java.lang.String getMetadataFileExtension(PluginToolsRequest request)
          Should be implemented in the sub classes.
protected abstract  java.lang.String getScriptFileExtension(PluginToolsRequest request)
           
 
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
 

Constructor Detail

AbstractScriptedMojoDescriptorExtractor

public AbstractScriptedMojoDescriptorExtractor()
Method Detail

execute

public java.util.List execute(org.apache.maven.project.MavenProject project,
                              org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
                       throws ExtractionException,
                              org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
Execute the mojo extraction.

Specified by:
execute in interface MojoDescriptorExtractor
Returns:
a list of mojo descriptors.
Throws:
ExtractionException - if any
org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException - if any

execute

public java.util.List execute(PluginToolsRequest request)
                       throws ExtractionException,
                              org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
Execute the mojo extraction.

Specified by:
execute in interface MojoDescriptorExtractor
Parameters:
request - The PluginToolsRequest containing information for the extraction process.
Returns:
a list of mojo descriptors.
Throws:
ExtractionException - if any
org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException - if any

copyScriptsToOutputDirectory

protected void copyScriptsToOutputDirectory(java.util.Map scriptFilesKeyedByBasedir,
                                            java.lang.String outputDirectory,
                                            PluginToolsRequest request)
                                     throws ExtractionException
Parameters:
scriptFilesKeyedByBasedir - not null
outputDirectory - not null
Throws:
ExtractionException - if any

gatherFilesByBasedir

protected java.util.Map gatherFilesByBasedir(java.io.File basedir,
                                             java.util.List directories,
                                             java.lang.String scriptFileExtension,
                                             PluginToolsRequest request)
Parameters:
basedir - not null
directories - not null
scriptFileExtension - not null
Returns:
map with subdirs paths as key

extractMojoDescriptorsFromMetadata

protected java.util.List extractMojoDescriptorsFromMetadata(java.util.Map metadataFilesKeyedByBasedir,
                                                            PluginToolsRequest request)
                                                     throws ExtractionException,
                                                            org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
Should be implemented in the sub classes.

Parameters:
metadataFilesKeyedByBasedir - could be null
request - The plugin request, never null.
Returns:
always null
Throws:
ExtractionException - if any
org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException - if any

getMetadataFileExtension

protected java.lang.String getMetadataFileExtension(PluginToolsRequest request)
Should be implemented in the sub classes.

Returns:
always null

extractMojoDescriptors

protected java.util.List extractMojoDescriptors(java.util.Map scriptFilesKeyedByBasedir,
                                                PluginToolsRequest request)
                                         throws ExtractionException,
                                                org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
Should be implemented in the sub classes.

Parameters:
scriptFilesKeyedByBasedir - could be null
request - The plugin request, never null.
Returns:
always null
Throws:
ExtractionException - if any
org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException - if any

getScriptFileExtension

protected abstract java.lang.String getScriptFileExtension(PluginToolsRequest request)
Returns:
the file extension like .bsh for BeanShell.


Copyright © 2004-2011 Apache Software Foundation. All Rights Reserved.