org.codehaus.mojo.pomtools
Class PomToolsPluginContext

java.lang.Object
  extended by org.codehaus.mojo.pomtools.wrapper.modify.AbstractModifiableObject
      extended by org.codehaus.mojo.pomtools.PomToolsPluginContext
All Implemented Interfaces:
Modifiable

public class PomToolsPluginContext
extends AbstractModifiableObject

Version:
$Id: PomToolsPluginContext.java 2166 2006-07-18 21:32:16Z carlos $
Author:
David Hawkins

Constructor Summary
PomToolsPluginContext(org.apache.maven.execution.MavenSession session, java.util.List remoteArtifactRepositories, org.apache.maven.artifact.repository.ArtifactRepository localRepository, PomToolsConfig config, boolean showUnparsedVersions, org.apache.maven.plugin.logging.Log log)
           
 
Method Summary
 ProjectWrapper getActiveProject()
           
 FieldConfiguration getFieldConfiguration(java.lang.String fieldName)
           
static PomToolsPluginContext getInstance()
          Returns the ThreadLocal instance of PomToolsPluginContext.
 org.apache.maven.plugin.logging.Log getLog()
           
 MetadataHelper getMetadataHelper()
           
 java.util.List getProjects()
           
 org.apache.maven.execution.MavenSession getSession()
           
static boolean hasCurrent()
           
 boolean isShowUnparsedVersions()
           
 java.util.List revertAllProjects()
          Reverts all projects to their unmodified state.
 java.util.List saveAllProjects()
          Saves all projects if they pass the model validation.
 void setActiveProjectIndex(int index)
           
static void setInstance(PomToolsPluginContext ctx)
          Sets the ThreadLocal PomToolsPluginContext instance.
 
Methods inherited from class org.codehaus.mojo.pomtools.wrapper.modify.AbstractModifiableObject
addChild, isModified, setModified, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PomToolsPluginContext

public PomToolsPluginContext(org.apache.maven.execution.MavenSession session,
                             java.util.List remoteArtifactRepositories,
                             org.apache.maven.artifact.repository.ArtifactRepository localRepository,
                             PomToolsConfig config,
                             boolean showUnparsedVersions,
                             org.apache.maven.plugin.logging.Log log)
                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException
Method Detail

getInstance

public static PomToolsPluginContext getInstance()
Returns the ThreadLocal instance of PomToolsPluginContext. You must call setInstance(PomToolsPluginContext) before calling this function.

Throws:
java.lang.IllegalStateException - if the current connection is not set

setInstance

public static void setInstance(PomToolsPluginContext ctx)
Sets the ThreadLocal PomToolsPluginContext instance. See #getCurrent for more information.


hasCurrent

public static boolean hasCurrent()

getFieldConfiguration

public FieldConfiguration getFieldConfiguration(java.lang.String fieldName)

getMetadataHelper

public MetadataHelper getMetadataHelper()

getLog

public org.apache.maven.plugin.logging.Log getLog()

getProjects

public java.util.List getProjects()

getActiveProject

public ProjectWrapper getActiveProject()

setActiveProjectIndex

public void setActiveProjectIndex(int index)

isShowUnparsedVersions

public boolean isShowUnparsedVersions()

saveAllProjects

public java.util.List saveAllProjects()
                               throws PomToolsException,
                                      org.apache.maven.project.ProjectBuildingException
Saves all projects if they pass the model validation.

Returns:
A List of ProjectValidationResult
Throws:
PomToolsException
org.apache.maven.project.ProjectBuildingException

revertAllProjects

public java.util.List revertAllProjects()
                                 throws PomToolsException
Reverts all projects to their unmodified state.

Returns:
A List of ProjectWrapper that were reverted
Throws:
PomToolsException

getSession

public org.apache.maven.execution.MavenSession getSession()


Copyright © 2009 The Codehaus. All Rights Reserved.