org.codehaus.mojo.freeform.analyser
Class BaseAnalyser

java.lang.Object
  extended by org.codehaus.mojo.freeform.analyser.Analyser
      extended by org.codehaus.mojo.freeform.analyser.BaseAnalyser
Direct Known Subclasses:
JarAnalyser, MavenPluginAnalyser

abstract class BaseAnalyser
extends Analyser

this abstract class contais the base methods for injecting basic functionnalities of a FreeformProject.

Author:
Raphaël Piéroni

Field Summary
 
Fields inherited from class org.codehaus.mojo.freeform.analyser.Analyser
antTargets, freeformProject, localRepository, log, mavenExecutedProject, mavenpath, mavenProject
 
Constructor Summary
BaseAnalyser()
           
 
Method Summary
protected  void addAntTarget(java.lang.String name, java.lang.String comment)
          This method adds an AntTarget to the list of ant target for generating the mavencall.xml file.
protected  void addAntTarget(java.lang.String name, java.lang.String mavenGoal, java.lang.String comment)
          This method adds an AntTarget to the list of ant target for generating the mavencall.xml file.
protected  void addAntTarget(java.lang.String name, java.lang.String mavenGoal, java.lang.String option, java.lang.String comment)
          This method adds an AntTarget to the list of ant target for generating the mavencall.xml file.
protected  void addCompilationUnit(java.lang.String relativeOutputDirectory, boolean unitTest, java.util.List relativeSourceRoots, java.util.List classpathElements, java.io.File mavenProjectBasedir, java.io.File localRepositoryBasedir)
          This method adds a CompilationUnit to the FreeformProject.
protected  void addCompileSourceRoots()
          This method adds the compile source roots of the MavenProject and the generated source roots of the mavenExecutedProject to the FreeformProject.
protected  void addCustomisedContextMenuItem(java.lang.String name, java.lang.String targets)
          This method adds a CustomisedContextMenuItem to the FreeformProject ContextMenu.
protected  void addFileViewItem(java.lang.String label, java.lang.String location)
          This method adds a FileViewItem to the FreeformProject views.
protected  void addIdeAction(java.lang.String name, java.lang.String targets)
          This adds a NamedNetbeansAction to the FreeformProject NetbeansActions.
protected  void addIdeContextItem(java.lang.String name)
          This method adds an IdeContextMenuItem to the FreeformProject ContextMenu.
protected  void addMainCompilationUnits()
          This method adds the CompilationUnit for the source roots of the MavenProject and for the generated source roots of the mavenExecutedProject to the FreeformProject.
protected  void addMavencallScript()
          This method adds the "ant.script" property leading to the mavencall.xml file.
protected  void addPropertyFile()
          This method adds the reference to the property file for the netbeans project.
protected  void addResourceFolderViewItem(java.lang.String resourceFolder)
          This method adds a FolderViewItem with tree style to the FreeformProject views.
protected  void addResources()
          This method adds the resource folders to the FreeformProject views.
protected  void addSiteDirectoy()
          This method adds the site folder to the FreeformProject views.
protected  void addSourceFolder(java.lang.String sourceRoot)
          This method adds a SourceFolder to the FreeformProject SourceFolders.
protected  void addSourceFolders()
          This method adds the mavenExecutedProject source roots to the FreeformProject source folders.
protected  void addSourceFolderViewItem(java.lang.String sourceFolder)
          This method adds a FolderViewItem with packages style to the FreeformProject views.
protected  void addSubproject(java.lang.String subprojectName)
          This method adds a Subprojectto the FreeformProject required projects.
protected  void addTargetDirectory()
          This method adds the target folder to the FreeformProject views.
protected  void addTestCompilationUnits()
          This method adds the CompilationUnit for the test source roots of the MavenProject and for the generated test source roots of the mavenExecutedProject to the FreeformProject.
protected  void addTestCompileSourceRoots()
          This method adds the test source roots of the MavenProject and the generated test source roots of the mavenExecutedProject to the FreeformProject.
protected  void addTestResources()
          This method adds the test resource folders to the FreeformProject views.
protected  void addTestSourceFolders()
          This method adds the mavenExecutedProject test source roots to the FreeformProject source folders.
 void analyseProject(boolean useOutputDirectory)
          This method role is to create the FreeformProject using the mavenProject, the mavenExecutedProject and the localRepository.
 void analyseTargets(boolean useOutputDirectory)
          This method role is to create the List of AntTarget using the mavenProject, the mavenExecutedProject and the localRepository.
protected  void setActionBuild()
          Sets the build ide action.
protected  void setActionClean()
          Sets the clean ide action.
protected  void setActionJavadoc()
          Sets the javadoc ide action.
protected  void setActionRebuild()
          Sets the rebuild ide action.
protected  void setActionRun()
          Sets the run ide action.
protected  void setActionTest()
          Sets the test ide action.
protected  void setFreeformCompilationUnits()
          Sets all the compilation units for the project.
protected  void setFreeformContextMenuItems()
          Sets the whole context menu for the project.
protected  void setFreeformIdeActions()
          Sets all the ide actions for the project.
protected  void setFreeformProjectName()
          This method sets the name of the FreeformProject using the one of the MavenProject.
protected  void setFreeformProperties()
          Sets all the properties form the project.
protected  void setFreeformSourceFolders()
          Sets all the source folders for the project.
protected  void setFreeformSubprojects()
          This method adds the modules of the MavenProject to the FreeformProject subprojects.
protected  void setFreeformViewItems()
          Sets all the view items for the project.
protected  void setMenuBuild()
          Sets the build menu item.
protected  void setMenuClean()
          Sets the clean menu item.
protected  void setMenuJalopy()
          Sets the format code menu item.
protected  void setMenuJavadoc()
          Sets the javadoc menu item.
protected  void setMenuRebuild()
          Sets the rebuild menu item.
protected  void setMenuRefreshProject()
          Sets the refresh project menu item.
protected  void setMenuRun()
          Sets the run menu item.
protected  void setMenuTest()
          Sets the test menu item.
protected  void setTargetBuild()
          Sets the build ant target.
protected  void setTargetClean()
          Sets the clean ant target.
protected  void setTargetJalopy()
          Sets the jalopy ant target.
protected  void setTargetJavadoc()
          Sets the javadoc ant target.
protected  void setTargetRefreshProject()
          Sets the refresh project ant target.
protected  void setTargetRun()
          Sets the run ant target.
protected  void setTargetTest()
          Sets the test ant target.
protected  void setViewPom()
          Sets the pom file view item.
protected  java.util.List toRelativeArtifactPaths(java.util.List classpathElements, java.io.File mavenProjectBasedir, java.io.File localRepositoryBasedir)
          This method, given a list of classpath elements with absobute paths, returns the same list of path elements with paths relative to the mavenProjectBasedir or the localRepositoryBasedir.
 
Methods inherited from class org.codehaus.mojo.freeform.analyser.Analyser
addAdditionalActions, addAdditionalFiles, addAdditionalFolders, addAdditionalTargets, analyseProject, Analyser, analyseTargets, createProject, createTargets, getAnalyser, getProject, getTargets, setLocalRepository, setLog, setMavenExecutedProject, setMavenPath, setMavenProject, toRelative, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BaseAnalyser

BaseAnalyser()
Method Detail

analyseProject

public void analyseProject(boolean useOutputDirectory)
                    throws FreeformPluginException
This method role is to create the FreeformProject using the mavenProject, the mavenExecutedProject and the localRepository.

This method override the Analyser's one.

Specified by:
analyseProject in class Analyser
Parameters:
useOutputDirectory - whether the project elements contains reference to the project directory or not.
Throws:
FreeformPluginException - if something goes wrong.

analyseTargets

public void analyseTargets(boolean useOutputDirectory)
                    throws FreeformPluginException
This method role is to create the List of AntTarget using the mavenProject, the mavenExecutedProject and the localRepository.

This method override the Analyser's one.

Specified by:
analyseTargets in class Analyser
Parameters:
useOutputDirectory - whether the project elements contains reference to the project directory or not.
Throws:
FreeformPluginException - if something goes wrong.

setActionBuild

protected void setActionBuild()
Sets the build ide action.


setActionClean

protected void setActionClean()
Sets the clean ide action.


setActionJavadoc

protected void setActionJavadoc()
Sets the javadoc ide action.


setActionRebuild

protected void setActionRebuild()
Sets the rebuild ide action.


setActionRun

protected void setActionRun()
Sets the run ide action.


setActionTest

protected void setActionTest()
Sets the test ide action.


setFreeformCompilationUnits

protected void setFreeformCompilationUnits()
                                    throws FreeformPluginException
Sets all the compilation units for the project.

Throws:
FreeformPluginException - if something goes wrong

setFreeformContextMenuItems

protected void setFreeformContextMenuItems()
Sets the whole context menu for the project.


setFreeformIdeActions

protected void setFreeformIdeActions()
Sets all the ide actions for the project.


setFreeformProjectName

protected void setFreeformProjectName()
This method sets the name of the FreeformProject using the one of the MavenProject.


setFreeformProperties

protected void setFreeformProperties()
Sets all the properties form the project.


setFreeformSourceFolders

protected void setFreeformSourceFolders()
Sets all the source folders for the project.


setFreeformSubprojects

protected void setFreeformSubprojects()
This method adds the modules of the MavenProject to the FreeformProject subprojects.


setFreeformViewItems

protected void setFreeformViewItems()
Sets all the view items for the project.


setMenuBuild

protected void setMenuBuild()
Sets the build menu item.


setMenuClean

protected void setMenuClean()
Sets the clean menu item.


setMenuJalopy

protected void setMenuJalopy()
Sets the format code menu item.


setMenuJavadoc

protected void setMenuJavadoc()
Sets the javadoc menu item.


setMenuRebuild

protected void setMenuRebuild()
Sets the rebuild menu item.


setMenuRefreshProject

protected void setMenuRefreshProject()
Sets the refresh project menu item.


setMenuRun

protected void setMenuRun()
Sets the run menu item.


setMenuTest

protected void setMenuTest()
Sets the test menu item.


setTargetBuild

protected void setTargetBuild()
Sets the build ant target.


setTargetClean

protected void setTargetClean()
Sets the clean ant target.


setTargetJalopy

protected void setTargetJalopy()
Sets the jalopy ant target.


setTargetJavadoc

protected void setTargetJavadoc()
Sets the javadoc ant target.


setTargetRefreshProject

protected void setTargetRefreshProject()
Sets the refresh project ant target.


setTargetRun

protected void setTargetRun()
Sets the run ant target.


setTargetTest

protected void setTargetTest()
Sets the test ant target.


setViewPom

protected void setViewPom()
Sets the pom file view item.


addAntTarget

protected void addAntTarget(java.lang.String name,
                            java.lang.String comment)
This method adds an AntTarget to the list of ant target for generating the mavencall.xml file.

Parameters:
comment - The description of the target in the ant file.
name - The name and only goal of the AntTarget.

addAntTarget

protected void addAntTarget(java.lang.String name,
                            java.lang.String mavenGoal,
                            java.lang.String comment)
This method adds an AntTarget to the list of ant target for generating the mavencall.xml file.

Parameters:
comment - The description of the target in the ant file.
name - The name of the AntTarget.
mavenGoal - The only goal of the AntTarget.

addAntTarget

protected void addAntTarget(java.lang.String name,
                            java.lang.String mavenGoal,
                            java.lang.String option,
                            java.lang.String comment)
This method adds an AntTarget to the list of ant target for generating the mavencall.xml file.

Parameters:
option - The option line of the AntTarget
comment - The description of the target in the ant file.
name - The name of the AntTarget.
mavenGoal - The only goal of the AntTarget.

addCompilationUnit

protected void addCompilationUnit(java.lang.String relativeOutputDirectory,
                                  boolean unitTest,
                                  java.util.List relativeSourceRoots,
                                  java.util.List classpathElements,
                                  java.io.File mavenProjectBasedir,
                                  java.io.File localRepositoryBasedir)
This method adds a CompilationUnit to the FreeformProject.

Parameters:
mavenProjectBasedir - The basedir of the maven project.
localRepositoryBasedir - The basedir of the local repository.
relativeSourceRoots - The list of source roots relative to the pom.
relativeOutputDirectory - The output directory relative to the pom.
unitTest - If the CompilationUnit is an unit test one.
classpathElements - The classpath elements for this CompilationUnit.

addCompileSourceRoots

protected void addCompileSourceRoots()
This method adds the compile source roots of the MavenProject and the generated source roots of the mavenExecutedProject to the FreeformProject.


addCustomisedContextMenuItem

protected void addCustomisedContextMenuItem(java.lang.String name,
                                            java.lang.String targets)
This method adds a CustomisedContextMenuItem to the FreeformProject ContextMenu.

Parameters:
name - The name (visible) of the ContextMenuItem.
targets - The list of AntTarget names for the ContextMenuItem.

addFileViewItem

protected void addFileViewItem(java.lang.String label,
                               java.lang.String location)
This method adds a FileViewItem to the FreeformProject views.

Parameters:
label - The label (visible) of the file.
location - The location of the file relative to the pom.

addIdeAction

protected void addIdeAction(java.lang.String name,
                            java.lang.String targets)
This adds a NamedNetbeansAction to the FreeformProject NetbeansActions.

Parameters:
name - The name of the NetbeansAction.
targets - The list of AntTarget for the NetbeansAction.

addIdeContextItem

protected void addIdeContextItem(java.lang.String name)
This method adds an IdeContextMenuItem to the FreeformProject ContextMenu.

Parameters:
name - The name of the NamedNetbeansAction for the MenuItem.

addMainCompilationUnits

protected void addMainCompilationUnits()
                                throws FreeformPluginException
This method adds the CompilationUnit for the source roots of the MavenProject and for the generated source roots of the mavenExecutedProject to the FreeformProject.

Throws:
FreeformPluginException - if something goes wrong.

addMavencallScript

protected void addMavencallScript()
This method adds the "ant.script" property leading to the mavencall.xml file.


addPropertyFile

protected void addPropertyFile()
This method adds the reference to the property file for the netbeans project.


addResourceFolderViewItem

protected void addResourceFolderViewItem(java.lang.String resourceFolder)
This method adds a FolderViewItem with tree style to the FreeformProject views.

Parameters:
resourceFolder - The name (visible) and location, relative to the pom, of the FolderViewItem.

addResources

protected void addResources()
This method adds the resource folders to the FreeformProject views.


addSiteDirectoy

protected void addSiteDirectoy()
This method adds the site folder to the FreeformProject views.


addSourceFolder

protected void addSourceFolder(java.lang.String sourceRoot)
This method adds a SourceFolder to the FreeformProject SourceFolders.

Parameters:
sourceRoot - The name and location, relative to the pom, of the SourceFolder.

addSourceFolderViewItem

protected void addSourceFolderViewItem(java.lang.String sourceFolder)
This method adds a FolderViewItem with packages style to the FreeformProject views.

Parameters:
sourceFolder - The name (visible) and location, relative to the pom, of the FolderViewItem.

addSourceFolders

protected void addSourceFolders()
This method adds the mavenExecutedProject source roots to the FreeformProject source folders.


addSubproject

protected void addSubproject(java.lang.String subprojectName)
This method adds a Subprojectto the FreeformProject required projects.

Parameters:
subprojectName - The location of the subproject relative to the pom.

addTargetDirectory

protected void addTargetDirectory()
This method adds the target folder to the FreeformProject views.


addTestCompilationUnits

protected void addTestCompilationUnits()
                                throws FreeformPluginException
This method adds the CompilationUnit for the test source roots of the MavenProject and for the generated test source roots of the mavenExecutedProject to the FreeformProject.

Throws:
FreeformPluginException - if something goes wrong.

addTestCompileSourceRoots

protected void addTestCompileSourceRoots()
This method adds the test source roots of the MavenProject and the generated test source roots of the mavenExecutedProject to the FreeformProject.


addTestResources

protected void addTestResources()
This method adds the test resource folders to the FreeformProject views.


addTestSourceFolders

protected void addTestSourceFolders()
This method adds the mavenExecutedProject test source roots to the FreeformProject source folders.


toRelativeArtifactPaths

protected java.util.List toRelativeArtifactPaths(java.util.List classpathElements,
                                                 java.io.File mavenProjectBasedir,
                                                 java.io.File localRepositoryBasedir)
This method, given a list of classpath elements with absobute paths, returns the same list of path elements with paths relative to the mavenProjectBasedir or the localRepositoryBasedir.

Parameters:
classpathElements - The list of classpath elements.
mavenProjectBasedir - The basedir of the maven project.
localRepositoryBasedir - The basedir of the local repository.
Returns:
The rlativised list of classpath elements.


Copyright 2005-2005-2006 null. All Rights Reserved.