org.apache.maven.project.artifact
Class ActiveProjectArtifact

java.lang.Object
  extended by org.apache.maven.project.artifact.ActiveProjectArtifact
All Implemented Interfaces:
java.lang.Comparable, Artifact

public class ActiveProjectArtifact
extends java.lang.Object
implements Artifact

Wraps an active project instance to be able to receive updates from its artifact without affecting the original attributes of this artifact.

Version:
$Id: ActiveProjectArtifact.java 495147 2007-01-11 07:47:53Z jvanzyl $
Author:
Brett Porter

Field Summary
 
Fields inherited from interface org.apache.maven.artifact.Artifact
LATEST_VERSION, RELEASE_VERSION, SCOPE_COMPILE, SCOPE_PROVIDED, SCOPE_RUNTIME, SCOPE_SYSTEM, SCOPE_TEST, SNAPSHOT_VERSION, VERSION_FILE_PATTERN
 
Constructor Summary
ActiveProjectArtifact(MavenProject project, Artifact artifact)
           
 
Method Summary
 void addMetadata(ArtifactMetadata metadata)
           
 int compareTo(java.lang.Object o)
           
 ArtifactHandler getArtifactHandler()
           
 java.lang.String getArtifactId()
           
 java.util.List getAvailableVersions()
           
 java.lang.String getBaseVersion()
           
 java.lang.String getClassifier()
           
 java.lang.String getDependencyConflictId()
           
 ArtifactFilter getDependencyFilter()
           
 java.util.List getDependencyTrail()
           
 java.lang.String getDownloadUrl()
           
 java.io.File getFile()
           
 java.lang.String getGroupId()
           
 java.lang.String getId()
           
 java.util.Collection getMetadataList()
           
 ArtifactRepository getRepository()
           
 java.lang.String getScope()
          Get the scope of the artifact.
 ArtifactVersion getSelectedVersion()
           
 java.lang.String getType()
           
 java.lang.String getVersion()
           
 VersionRange getVersionRange()
           
 boolean hasClassifier()
           
 boolean isOptional()
           
 boolean isRelease()
           
 boolean isResolved()
           
 boolean isSelectedVersionKnown()
           
 boolean isSnapshot()
           
 void selectVersion(java.lang.String version)
           
 void setArtifactHandler(ArtifactHandler handler)
           
 void setArtifactId(java.lang.String artifactId)
           
 void setAvailableVersions(java.util.List versions)
           
 void setBaseVersion(java.lang.String baseVersion)
           
 void setDependencyFilter(ArtifactFilter artifactFilter)
           
 void setDependencyTrail(java.util.List dependencyTrail)
           
 void setDownloadUrl(java.lang.String downloadUrl)
           
 void setFile(java.io.File destination)
           
 void setGroupId(java.lang.String groupId)
           
 void setOptional(boolean optional)
           
 void setRelease(boolean release)
           
 void setRepository(ArtifactRepository remoteRepository)
           
 void setResolved(boolean resolved)
           
 void setResolvedVersion(java.lang.String version)
           
 void setScope(java.lang.String scope)
           
 void setVersion(java.lang.String version)
           
 void setVersionRange(VersionRange newRange)
           
 java.lang.String toString()
           
 void updateVersion(java.lang.String version, ArtifactRepository localRepository)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ActiveProjectArtifact

public ActiveProjectArtifact(MavenProject project,
                             Artifact artifact)
Method Detail

getFile

public java.io.File getFile()
Specified by:
getFile in interface Artifact

getGroupId

public java.lang.String getGroupId()
Specified by:
getGroupId in interface Artifact

getArtifactId

public java.lang.String getArtifactId()
Specified by:
getArtifactId in interface Artifact

getVersion

public java.lang.String getVersion()
Specified by:
getVersion in interface Artifact

setVersion

public void setVersion(java.lang.String version)
Specified by:
setVersion in interface Artifact

getScope

public java.lang.String getScope()
Description copied from interface: Artifact
Get the scope of the artifact. If the artifact is a standalone rather than a dependency, it's scope will be null. The scope may not be the same as it was declared on the original dependency, as this is the result of combining it with the main project scope.

Specified by:
getScope in interface Artifact
Returns:
the scope

getType

public java.lang.String getType()
Specified by:
getType in interface Artifact

getClassifier

public java.lang.String getClassifier()
Specified by:
getClassifier in interface Artifact

hasClassifier

public boolean hasClassifier()
Specified by:
hasClassifier in interface Artifact

setFile

public void setFile(java.io.File destination)
Specified by:
setFile in interface Artifact

getBaseVersion

public java.lang.String getBaseVersion()
Specified by:
getBaseVersion in interface Artifact

setBaseVersion

public void setBaseVersion(java.lang.String baseVersion)
Specified by:
setBaseVersion in interface Artifact

getId

public java.lang.String getId()
Specified by:
getId in interface Artifact

getDependencyConflictId

public java.lang.String getDependencyConflictId()
Specified by:
getDependencyConflictId in interface Artifact

addMetadata

public void addMetadata(ArtifactMetadata metadata)
Specified by:
addMetadata in interface Artifact

getMetadataList

public java.util.Collection getMetadataList()
Specified by:
getMetadataList in interface Artifact

setRepository

public void setRepository(ArtifactRepository remoteRepository)
Specified by:
setRepository in interface Artifact

getRepository

public ArtifactRepository getRepository()
Specified by:
getRepository in interface Artifact

updateVersion

public void updateVersion(java.lang.String version,
                          ArtifactRepository localRepository)
Specified by:
updateVersion in interface Artifact

getDownloadUrl

public java.lang.String getDownloadUrl()
Specified by:
getDownloadUrl in interface Artifact

setDownloadUrl

public void setDownloadUrl(java.lang.String downloadUrl)
Specified by:
setDownloadUrl in interface Artifact

getDependencyFilter

public ArtifactFilter getDependencyFilter()
Specified by:
getDependencyFilter in interface Artifact

setDependencyFilter

public void setDependencyFilter(ArtifactFilter artifactFilter)
Specified by:
setDependencyFilter in interface Artifact

getArtifactHandler

public ArtifactHandler getArtifactHandler()
Specified by:
getArtifactHandler in interface Artifact

getDependencyTrail

public java.util.List getDependencyTrail()
Specified by:
getDependencyTrail in interface Artifact

setDependencyTrail

public void setDependencyTrail(java.util.List dependencyTrail)
Specified by:
setDependencyTrail in interface Artifact

setScope

public void setScope(java.lang.String scope)
Specified by:
setScope in interface Artifact

getVersionRange

public VersionRange getVersionRange()
Specified by:
getVersionRange in interface Artifact

setVersionRange

public void setVersionRange(VersionRange newRange)
Specified by:
setVersionRange in interface Artifact

selectVersion

public void selectVersion(java.lang.String version)
Specified by:
selectVersion in interface Artifact

setGroupId

public void setGroupId(java.lang.String groupId)
Specified by:
setGroupId in interface Artifact

setArtifactId

public void setArtifactId(java.lang.String artifactId)
Specified by:
setArtifactId in interface Artifact

isSnapshot

public boolean isSnapshot()
Specified by:
isSnapshot in interface Artifact

compareTo

public int compareTo(java.lang.Object o)
Specified by:
compareTo in interface java.lang.Comparable

setResolved

public void setResolved(boolean resolved)
Specified by:
setResolved in interface Artifact

isResolved

public boolean isResolved()
Specified by:
isResolved in interface Artifact

setResolvedVersion

public void setResolvedVersion(java.lang.String version)
Specified by:
setResolvedVersion in interface Artifact

setArtifactHandler

public void setArtifactHandler(ArtifactHandler handler)
Specified by:
setArtifactHandler in interface Artifact

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isRelease

public boolean isRelease()
Specified by:
isRelease in interface Artifact

setRelease

public void setRelease(boolean release)
Specified by:
setRelease in interface Artifact

getAvailableVersions

public java.util.List getAvailableVersions()
Specified by:
getAvailableVersions in interface Artifact

setAvailableVersions

public void setAvailableVersions(java.util.List versions)
Specified by:
setAvailableVersions in interface Artifact

isOptional

public boolean isOptional()
Specified by:
isOptional in interface Artifact

getSelectedVersion

public ArtifactVersion getSelectedVersion()
                                   throws OverConstrainedVersionException
Specified by:
getSelectedVersion in interface Artifact
Throws:
OverConstrainedVersionException

isSelectedVersionKnown

public boolean isSelectedVersionKnown()
                               throws OverConstrainedVersionException
Specified by:
isSelectedVersionKnown in interface Artifact
Throws:
OverConstrainedVersionException

setOptional

public void setOptional(boolean optional)
Specified by:
setOptional in interface Artifact


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.