org.codehaus.mojo.jsimport
Class AbstractImportMojo

java.lang.Object
  extended by org.apache.maven.plugin.AbstractMojo
      extended by org.codehaus.mojo.jsimport.AbstractImportMojo
All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled, org.apache.maven.plugin.Mojo
Direct Known Subclasses:
ImportMojo, TestImportMojo

public abstract class AbstractImportMojo
extends org.apache.maven.plugin.AbstractMojo

Mojo for resolving dependencies either declared using an @import javadoc statement or by declaration of uninitialised variables.


Nested Class Summary
protected static class AbstractImportMojo.Scope
          The current project scope.
 
Field Summary
 
Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE
 
Constructor Summary
AbstractImportMojo()
           
 
Method Summary
protected  void doExecute(File sourceJsFolder, File targetFolder, File workFolder, AbstractImportMojo.Scope scope)
          Perform the goal of this mojo.
 org.apache.maven.artifact.factory.ArtifactFactory getArtifactFactory()
           
 org.apache.maven.artifact.metadata.ArtifactMetadataSource getArtifactMetadataSource()
           
 List<org.apache.maven.model.Dependency> getDependencies()
           
 List<String> getExcludes()
           
 Map<String,String> getFileAssignedGlobals()
           
 Map<String,LinkedHashSet<String>> getFileDependencies()
           
 Map<String,Set<String>> getFileUnassignedGlobals()
           
 List<String> getIncludes()
           
 org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
           
 org.apache.maven.project.MavenProject getProject()
           
 List<?> getRemoteRepositories()
           
 org.apache.maven.artifact.resolver.ArtifactResolver getResolver()
           
 boolean isAssumeABrowser()
           
protected  boolean processFileForImportsAndSymbols(File sourceFolder, File targetFolder, File sourceFile, long fileDependencyGraphModificationTime, Set<?> transitiveArtifacts)
          Process a file for import declarations and for the symbols used.
protected  void processSourceFilesForUnassignedSymbolDeclarations()
          Go through all of unassigned globals and enhance the file dependencies collection given the file that they are declared in.
 void setArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory)
           
 void setArtifactMetadataSource(org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource)
           
 void setAssumeABrowser(boolean assumeABrowser)
           
 void setDependencies(List<org.apache.maven.model.Dependency> dependencies)
           
 void setExcludes(List<String> excludes)
           
 void setIncludes(List<String> includes)
           
 void setLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository)
           
 void setProject(org.apache.maven.project.MavenProject project)
           
 void setRemoteRepositories(List<?> remoteRepositories)
           
 void setResolver(org.apache.maven.artifact.resolver.ArtifactResolver resolver)
           
 
Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.maven.plugin.Mojo
execute
 

Constructor Detail

AbstractImportMojo

public AbstractImportMojo()
Method Detail

doExecute

protected void doExecute(File sourceJsFolder,
                         File targetFolder,
                         File workFolder,
                         AbstractImportMojo.Scope scope)
                  throws org.apache.maven.plugin.MojoExecutionException
Perform the goal of this mojo.

Parameters:
sourceJsFolder - the folder where the source js files reside.
targetFolder - the folder where the target files reside.
workFolder - the folder where our work files can be found.
scope - scope the scope of the dependencies we are to search for.
Throws:
org.apache.maven.plugin.MojoExecutionException - if there is an execution failure.

getArtifactFactory

public org.apache.maven.artifact.factory.ArtifactFactory getArtifactFactory()
Returns:
property.

getArtifactMetadataSource

public org.apache.maven.artifact.metadata.ArtifactMetadataSource getArtifactMetadataSource()
Returns:
property.

getDependencies

public List<org.apache.maven.model.Dependency> getDependencies()
Returns:
property.

getExcludes

public List<String> getExcludes()
Returns:
property.

getFileAssignedGlobals

public Map<String,String> getFileAssignedGlobals()
Returns:
property.

getFileDependencies

public Map<String,LinkedHashSet<String>> getFileDependencies()
Returns:
property.

getFileUnassignedGlobals

public Map<String,Set<String>> getFileUnassignedGlobals()
Returns:
property.

getIncludes

public List<String> getIncludes()
Returns:
property.

getLocalRepository

public org.apache.maven.artifact.repository.ArtifactRepository getLocalRepository()
Returns:
property.

getProject

public org.apache.maven.project.MavenProject getProject()
Returns:
property.

getRemoteRepositories

public List<?> getRemoteRepositories()
Returns:
property.

getResolver

public org.apache.maven.artifact.resolver.ArtifactResolver getResolver()
Returns:
property.

isAssumeABrowser

public boolean isAssumeABrowser()
Returns:
property.

processFileForImportsAndSymbols

protected boolean processFileForImportsAndSymbols(File sourceFolder,
                                                  File targetFolder,
                                                  File sourceFile,
                                                  long fileDependencyGraphModificationTime,
                                                  Set<?> transitiveArtifacts)
                                           throws org.apache.maven.plugin.MojoExecutionException
Process a file for import declarations and for the symbols used.

Parameters:
sourceFolder - the base directory of the file being processed.
targetFolder - where to write files to.
sourceFile - the file to process.
fileDependencyGraphModificationTime - the last time the dependency graph was updated or 0 if we do not have one.
transitiveArtifacts - any transititive artifacts to match imports against, or null if no matching is to be done.
Returns:
true if processing occurred.
Throws:
org.apache.maven.plugin.MojoExecutionException - if something goes wrong.

processSourceFilesForUnassignedSymbolDeclarations

protected void processSourceFilesForUnassignedSymbolDeclarations()
                                                          throws org.apache.maven.plugin.MojoExecutionException
Go through all of unassigned globals and enhance the file dependencies collection given the file that they are declared in.

Throws:
org.apache.maven.plugin.MojoExecutionException - if something goes wrong.

setArtifactFactory

public void setArtifactFactory(org.apache.maven.artifact.factory.ArtifactFactory artifactFactory)
Parameters:
artifactFactory - set property.

setArtifactMetadataSource

public void setArtifactMetadataSource(org.apache.maven.artifact.metadata.ArtifactMetadataSource artifactMetadataSource)
Parameters:
artifactMetadataSource - set property.

setAssumeABrowser

public void setAssumeABrowser(boolean assumeABrowser)
Parameters:
assumeABrowser - set property.

setDependencies

public void setDependencies(List<org.apache.maven.model.Dependency> dependencies)
Parameters:
dependencies - set property.

setExcludes

public void setExcludes(List<String> excludes)
Parameters:
excludes - set property.

setIncludes

public void setIncludes(List<String> includes)
Parameters:
includes - set property.

setLocalRepository

public void setLocalRepository(org.apache.maven.artifact.repository.ArtifactRepository localRepository)
Parameters:
localRepository - set property.

setProject

public void setProject(org.apache.maven.project.MavenProject project)
Parameters:
project - set property.

setRemoteRepositories

public void setRemoteRepositories(List<?> remoteRepositories)
Parameters:
remoteRepositories - set property.

setResolver

public void setResolver(org.apache.maven.artifact.resolver.ArtifactResolver resolver)
Parameters:
resolver - set property.


Copyright © 2010-2012 Codehaus. All Rights Reserved.