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 684236 2008-08-09 12:11:34Z vsiveton $
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)
           
 java.util.List execute(org.apache.maven.project.MavenProject project, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
          Execute the mojo extraction.
protected  java.util.List extractMojoDescriptors(java.util.Map scriptFilesKeyedByBasedir, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
          Should be implemented in the sub classes.
protected  java.util.List extractMojoDescriptorsFromMetadata(java.util.Map metadataFilesKeyedByBasedir, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
          Should be implemented in the sub classes.
protected  java.util.Map gatherFilesByBasedir(java.io.File basedir, java.util.List directories, java.lang.String scriptFileExtension)
           
protected  java.lang.String getMetadataFileExtension()
          Should be implemented in the sub classes.
protected abstract  java.lang.String getScriptFileExtension()
           
 
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
Parameters:
project - not null Maven project
pluginDescriptor - not null plugin descriptor
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)
                                     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)
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,
                                                            org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
                                                     throws ExtractionException,
                                                            org.apache.maven.plugin.descriptor.InvalidPluginDescriptorException
Should be implemented in the sub classes.

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

getMetadataFileExtension

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

Returns:
always null

extractMojoDescriptors

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

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

getScriptFileExtension

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


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