org.apache.maven.project.builder
Class PomClassicDomainModel

java.lang.Object
  extended by org.apache.maven.project.builder.PomClassicDomainModel
All Implemented Interfaces:
org.apache.maven.shared.model.DomainModel, org.apache.maven.shared.model.InputStreamDomainModel

public final class PomClassicDomainModel
extends java.lang.Object
implements org.apache.maven.shared.model.InputStreamDomainModel

Provides a wrapper for the maven model.


Constructor Summary
PomClassicDomainModel(java.io.File file)
           
PomClassicDomainModel(java.io.InputStream inputStream)
          Constructor
PomClassicDomainModel(Model model)
          Constructor
 
Method Summary
 java.lang.String asString()
          Returns XML model as string
 boolean equals(java.lang.Object o)
          Returns true if this.asString.equals(o.asString()), otherwise false.
 java.lang.String getEventHistory()
           
 java.io.File getFile()
           
 java.lang.String getId()
           
 java.io.InputStream getInputStream()
           
 int getLineageCount()
           
 Model getModel()
          Returns maven model
 java.util.List<org.apache.maven.shared.model.ModelProperty> getModelProperties()
           
 java.io.File getParentFile()
           
 java.io.File getProjectDirectory()
           
 boolean isPomInBuild()
           
 boolean matchesModel(Model a)
          Returns true if groupId.equals(a.groupId) && artifactId.equals(a.artifactId) && version.equals(a.version), otherwise returns false.
 boolean matchesParent(Parent parent)
           
 void setEventHistory(java.lang.String eventHistory)
           
 void setLineageCount(int lineageCount)
           
 void setParentFile(java.io.File parentFile)
           
 void setProjectDirectory(java.io.File projectDirectory)
          This should only be set for projects that are in the build.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PomClassicDomainModel

public PomClassicDomainModel(Model model)
                      throws java.io.IOException
Constructor

Parameters:
model - maven model
Throws:
java.io.IOException - if there is a problem constructing the model

PomClassicDomainModel

public PomClassicDomainModel(java.io.InputStream inputStream)
                      throws java.io.IOException
Constructor

Parameters:
inputStream - input stream of the maven model
Throws:
java.io.IOException - if there is a problem constructing the model

PomClassicDomainModel

public PomClassicDomainModel(java.io.File file)
                      throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getParentFile

public java.io.File getParentFile()

setParentFile

public void setParentFile(java.io.File parentFile)

setProjectDirectory

public void setProjectDirectory(java.io.File projectDirectory)
This should only be set for projects that are in the build. Setting for poms in the repo may cause unstable behavior.

Parameters:
projectDirectory -

getProjectDirectory

public java.io.File getProjectDirectory()

isPomInBuild

public boolean isPomInBuild()

matchesModel

public boolean matchesModel(Model a)
Returns true if groupId.equals(a.groupId) && artifactId.equals(a.artifactId) && version.equals(a.version), otherwise returns false.

Parameters:
a - model to compare
Returns:
true if groupId.equals(a.groupId) && artifactId.equals(a.artifactId) && version.equals(a.version), otherwise returns false.

getId

public java.lang.String getId()

matchesParent

public boolean matchesParent(Parent parent)

asString

public java.lang.String asString()
Returns XML model as string

Returns:
XML model as string

getModel

public Model getModel()
               throws java.io.IOException
Returns maven model

Returns:
maven model
Throws:
java.io.IOException

getInputStream

public java.io.InputStream getInputStream()
Specified by:
getInputStream in interface org.apache.maven.shared.model.InputStreamDomainModel
See Also:
InputStreamDomainModel.getInputStream()

getFile

public java.io.File getFile()
Returns:
file of pom. May be null.

getModelProperties

public java.util.List<org.apache.maven.shared.model.ModelProperty> getModelProperties()
                                                                               throws java.io.IOException
Specified by:
getModelProperties in interface org.apache.maven.shared.model.DomainModel
Throws:
java.io.IOException

getEventHistory

public java.lang.String getEventHistory()
Specified by:
getEventHistory in interface org.apache.maven.shared.model.DomainModel
See Also:
DomainModel.getEventHistory()

setEventHistory

public void setEventHistory(java.lang.String eventHistory)
Specified by:
setEventHistory in interface org.apache.maven.shared.model.DomainModel
See Also:
DomainModel.setEventHistory(String)

getLineageCount

public int getLineageCount()

setLineageCount

public void setLineageCount(int lineageCount)

equals

public boolean equals(java.lang.Object o)
Returns true if this.asString.equals(o.asString()), otherwise false.

Overrides:
equals in class java.lang.Object
Parameters:
o - domain model
Returns:
true if this.asString.equals(o.asString()), otherwise false.


Copyright © 2001-2009 The Apache Software Foundation. All Rights Reserved.