org.codehaus.mojo.pomtools.wrapper.custom
Class ProjectWrapper

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

public class ProjectWrapper
extends AbstractModifiableObject

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

Constructor Summary
ProjectWrapper(Modifiable parentMod, org.apache.maven.project.MavenProject project)
           
 
Method Summary
protected  org.apache.maven.project.MavenProject createTempResolvedProject(org.apache.maven.model.Model model)
          Creates a temporary MavenProject from the current contents of our wrappedModel.
 ObjectWrapper findDependency(org.apache.maven.artifact.Artifact artifact)
           
 org.apache.maven.model.Dependency findResolvedDependency(DependencyWrapper dep)
           
 String getArtifactId()
           
 File getBaseDir()
           
 File getFile()
           
 String getGroupId()
           
 org.apache.maven.project.MavenProject getTemporaryResolvedProject()
           
 String getValueLabel()
           
 String getVersion()
           
 ObjectWrapper getWrappedModel()
           
protected  void initializeModel()
           
protected  org.apache.maven.model.Model readModel(File pomFile)
           
 void revert()
           
 void save()
           
 void setModified(boolean modified)
          Setting modified to true propagates the value up to our parent.
 ProjectValidationResult validateModel()
           
 ProjectValidationResult validateModel(org.apache.maven.model.Model model)
           
static void writeModel(File pomFile, org.apache.maven.model.Model model)
           
 
Methods inherited from class org.codehaus.mojo.pomtools.wrapper.modify.AbstractModifiableObject
addChild, isModified, setModified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectWrapper

public ProjectWrapper(Modifiable parentMod,
                      org.apache.maven.project.MavenProject project)
               throws PomToolsException
Throws:
PomToolsException
Method Detail

initializeModel

protected void initializeModel()
                        throws PomToolsException
Throws:
PomToolsException

getWrappedModel

public ObjectWrapper getWrappedModel()

createTempResolvedProject

protected org.apache.maven.project.MavenProject createTempResolvedProject(org.apache.maven.model.Model model)
                                                                   throws PomToolsException,
                                                                          org.apache.maven.project.ProjectBuildingException,
                                                                          org.apache.maven.project.InvalidProjectModelException
Creates a temporary MavenProject from the current contents of our wrappedModel. This is usefule when performing operations that need full model resolution. For example, dependencies that inherit their versions from the parent pom.

Throws:
PomToolsException
org.apache.maven.project.ProjectBuildingException
org.apache.maven.project.InvalidProjectModelException

setModified

public void setModified(boolean modified)
Description copied from class: AbstractModifiableObject
Setting modified to true propagates the value up to our parent. Setting it to false will propagate down to our children.

If I am modified, that makes my parent modified. However, if I am setting my modified to false, that does not mean my parent is no longer modified.

Specified by:
setModified in interface Modifiable
Overrides:
setModified in class AbstractModifiableObject

getTemporaryResolvedProject

public org.apache.maven.project.MavenProject getTemporaryResolvedProject()
                                                                  throws PomToolsException,
                                                                         org.apache.maven.project.InvalidProjectModelException,
                                                                         org.apache.maven.project.ProjectBuildingException
Throws:
PomToolsException
org.apache.maven.project.InvalidProjectModelException
org.apache.maven.project.ProjectBuildingException

findResolvedDependency

public org.apache.maven.model.Dependency findResolvedDependency(DependencyWrapper dep)
                                                         throws PomToolsException
Throws:
PomToolsException

getGroupId

public String getGroupId()

getArtifactId

public String getArtifactId()

getVersion

public String getVersion()

getValueLabel

public String getValueLabel()

getBaseDir

public File getBaseDir()

getFile

public File getFile()

validateModel

public ProjectValidationResult validateModel()
                                      throws org.apache.maven.project.ProjectBuildingException,
                                             PomToolsException
Throws:
org.apache.maven.project.ProjectBuildingException
PomToolsException

validateModel

public ProjectValidationResult validateModel(org.apache.maven.model.Model model)

save

public void save()
          throws IOException
Throws:
IOException

revert

public void revert()
            throws PomToolsException
Throws:
PomToolsException

writeModel

public static void writeModel(File pomFile,
                              org.apache.maven.model.Model model)
                       throws IOException
Throws:
IOException

readModel

protected org.apache.maven.model.Model readModel(File pomFile)
                                          throws PomToolsException
Throws:
PomToolsException

findDependency

public ObjectWrapper findDependency(org.apache.maven.artifact.Artifact artifact)


Copyright © 2011 The Codehaus. All Rights Reserved.