org.apache.maven.plugin.testing.stubs
Class ArtifactStub

java.lang.Object
  extended by org.apache.maven.plugin.testing.stubs.ArtifactStub
All Implemented Interfaces:
Comparable, Artifact

public class ArtifactStub
extends Object
implements Artifact

Stub class for Artifact testing.

Version:
$Id: ArtifactStub.java 568185 2007-08-21 16:11:01Z handyande $
Author:
jesse

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
ArtifactStub()
           
 
Method Summary
 void addMetadata(ArtifactMetadata artifactMetadata)
          By default, do nothing.
 int compareTo(Object object)
          By default, return 0
 ArtifactHandler getArtifactHandler()
          By default, return null.
 String getArtifactId()
           
 List getAvailableVersions()
          By default, return null.
 String getBaseVersion()
          By default, return null.
 String getClassifier()
           
 String getDependencyConflictId()
          By default, return groupId:artifactId:type:classifier.
 ArtifactFilter getDependencyFilter()
          By default, return null.
 List getDependencyTrail()
          By default, return null.
 String getDownloadUrl()
          By default, return null.
 File getFile()
           
 String getGroupId()
           
 String getId()
          By default, return null.
 Collection getMetadataList()
          By default, return null.
 ArtifactRepository getRepository()
          Returns repository for artifact
 String getScope()
           
 ArtifactVersion getSelectedVersion()
          By default, return null.
 String getType()
           
 String getVersion()
           
 VersionRange getVersionRange()
          By default, return null.
 boolean hasClassifier()
           
 boolean isOptional()
          By default, return false.
 boolean isRelease()
          By default, return false.
 boolean isResolved()
          By default, return false.
 boolean isSelectedVersionKnown()
          By default, return false.
 boolean isSnapshot()
          By default, return false.
 void selectVersion(String string)
          By default, do nothing.
 void setArtifactHandler(ArtifactHandler artifactHandler)
          By default, do nothing.
 void setArtifactId(String artifactId)
           
 void setAvailableVersions(List list)
          By default, do nothing.
 void setBaseVersion(String string)
          By default, do nothing.
 void setDependencyFilter(ArtifactFilter artifactFilter)
          By default, do nothing.
 void setDependencyTrail(List list)
          By default, do nothing.
 void setDownloadUrl(String string)
          By default, do nothing.
 void setFile(File file)
           
 void setGroupId(String groupId)
           
 void setOptional(boolean b)
          By default, do nothing.
 void setRelease(boolean b)
          By default, do nothing.
 void setRepository(ArtifactRepository artifactRepository)
          Set a new artifact repository
 void setResolved(boolean b)
          By default, do nothing.
 void setResolvedVersion(String string)
          By default, do nothing.
 void setScope(String scope)
           
 void setType(String type)
          Set a new type
 void setVersion(String version)
           
 void setVersionRange(VersionRange versionRange)
          By default, do nothing.
 String toString()
           
 void updateVersion(String string, ArtifactRepository artifactRepository)
          By default, do nothing.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArtifactStub

public ArtifactStub()
Method Detail

compareTo

public int compareTo(Object object)
By default, return 0

Specified by:
compareTo in interface Comparable
See Also:
Comparable.compareTo(java.lang.Object)

getGroupId

public String getGroupId()
Specified by:
getGroupId in interface Artifact
See Also:
Artifact.getGroupId()

getArtifactId

public String getArtifactId()
Specified by:
getArtifactId in interface Artifact
See Also:
Artifact.getArtifactId()

getVersion

public String getVersion()
Specified by:
getVersion in interface Artifact
See Also:
Artifact.getVersion()

setVersion

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

getScope

public String getScope()
Specified by:
getScope in interface Artifact
See Also:
Artifact.getScope()

getType

public String getType()
Specified by:
getType in interface Artifact
See Also:
Artifact.getType()

setType

public void setType(String type)
Set a new type

Parameters:
type -

getClassifier

public String getClassifier()
Specified by:
getClassifier in interface Artifact
See Also:
Artifact.getClassifier()

hasClassifier

public boolean hasClassifier()
Specified by:
hasClassifier in interface Artifact
See Also:
Artifact.hasClassifier()

getFile

public File getFile()
Specified by:
getFile in interface Artifact
See Also:
Artifact.getFile()

setFile

public void setFile(File file)
Specified by:
setFile in interface Artifact
See Also:
Artifact.setFile(java.io.File)

getBaseVersion

public String getBaseVersion()
By default, return null.

Specified by:
getBaseVersion in interface Artifact
See Also:
Artifact.getBaseVersion()

setBaseVersion

public void setBaseVersion(String string)
By default, do nothing.

Specified by:
setBaseVersion in interface Artifact
See Also:
Artifact.setBaseVersion(java.lang.String)

getId

public String getId()
By default, return null.

Specified by:
getId in interface Artifact
See Also:
Artifact.getId()

getDependencyConflictId

public String getDependencyConflictId()
By default, return groupId:artifactId:type:classifier.

Specified by:
getDependencyConflictId in interface Artifact
See Also:
Artifact.getDependencyConflictId()

addMetadata

public void addMetadata(ArtifactMetadata artifactMetadata)
By default, do nothing.

Specified by:
addMetadata in interface Artifact
See Also:
Artifact.addMetadata(org.apache.maven.artifact.metadata.ArtifactMetadata)

getMetadataList

public Collection getMetadataList()
By default, return null.

Specified by:
getMetadataList in interface Artifact
See Also:
Artifact.getMetadataList()

setRepository

public void setRepository(ArtifactRepository artifactRepository)
Set a new artifact repository

Specified by:
setRepository in interface Artifact
See Also:
Artifact.setRepository(org.apache.maven.artifact.repository.ArtifactRepository)

getRepository

public ArtifactRepository getRepository()
Returns repository for artifact

Specified by:
getRepository in interface Artifact
See Also:
Artifact.getRepository()

updateVersion

public void updateVersion(String string,
                          ArtifactRepository artifactRepository)
By default, do nothing.

Specified by:
updateVersion in interface Artifact
See Also:
Artifact.updateVersion(java.lang.String, org.apache.maven.artifact.repository.ArtifactRepository)

getDownloadUrl

public String getDownloadUrl()
By default, return null.

Specified by:
getDownloadUrl in interface Artifact
See Also:
Artifact.getDownloadUrl()

setDownloadUrl

public void setDownloadUrl(String string)
By default, do nothing.

Specified by:
setDownloadUrl in interface Artifact
See Also:
Artifact.setDownloadUrl(java.lang.String)

getDependencyFilter

public ArtifactFilter getDependencyFilter()
By default, return null.

Specified by:
getDependencyFilter in interface Artifact
See Also:
Artifact.getDependencyFilter()

setDependencyFilter

public void setDependencyFilter(ArtifactFilter artifactFilter)
By default, do nothing.

Specified by:
setDependencyFilter in interface Artifact
See Also:
Artifact.setDependencyFilter(org.apache.maven.artifact.resolver.filter.ArtifactFilter)

getArtifactHandler

public ArtifactHandler getArtifactHandler()
By default, return null.

Specified by:
getArtifactHandler in interface Artifact
See Also:
Artifact.getArtifactHandler()

getDependencyTrail

public List getDependencyTrail()
By default, return null.

Specified by:
getDependencyTrail in interface Artifact
See Also:
Artifact.getDependencyTrail()

setDependencyTrail

public void setDependencyTrail(List list)
By default, do nothing.

Specified by:
setDependencyTrail in interface Artifact
See Also:
Artifact.setDependencyTrail(java.util.List)

setScope

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

getVersionRange

public VersionRange getVersionRange()
By default, return null.

Specified by:
getVersionRange in interface Artifact
See Also:
Artifact.getVersionRange()

setVersionRange

public void setVersionRange(VersionRange versionRange)
By default, do nothing.

Specified by:
setVersionRange in interface Artifact
See Also:
Artifact.setVersionRange(org.apache.maven.artifact.versioning.VersionRange)

selectVersion

public void selectVersion(String string)
By default, do nothing.

Specified by:
selectVersion in interface Artifact
See Also:
Artifact.selectVersion(java.lang.String)

setGroupId

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

setArtifactId

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

isSnapshot

public boolean isSnapshot()
By default, return false.

Specified by:
isSnapshot in interface Artifact
See Also:
Artifact.isSnapshot()

setResolved

public void setResolved(boolean b)
By default, do nothing.

Specified by:
setResolved in interface Artifact
See Also:
Artifact.setResolved(boolean)

isResolved

public boolean isResolved()
By default, return false.

Specified by:
isResolved in interface Artifact
See Also:
Artifact.isResolved()

setResolvedVersion

public void setResolvedVersion(String string)
By default, do nothing.

Specified by:
setResolvedVersion in interface Artifact
See Also:
Artifact.setResolvedVersion(java.lang.String)

setArtifactHandler

public void setArtifactHandler(ArtifactHandler artifactHandler)
By default, do nothing.

Specified by:
setArtifactHandler in interface Artifact
See Also:
Artifact.setArtifactHandler(org.apache.maven.artifact.handler.ArtifactHandler)

isRelease

public boolean isRelease()
By default, return false.

Specified by:
isRelease in interface Artifact
See Also:
Artifact.isRelease()

setRelease

public void setRelease(boolean b)
By default, do nothing.

Specified by:
setRelease in interface Artifact
See Also:
Artifact.setRelease(boolean)

getAvailableVersions

public List getAvailableVersions()
By default, return null.

Specified by:
getAvailableVersions in interface Artifact
See Also:
Artifact.getAvailableVersions()

setAvailableVersions

public void setAvailableVersions(List list)
By default, do nothing.

Specified by:
setAvailableVersions in interface Artifact
See Also:
Artifact.setAvailableVersions(java.util.List)

isOptional

public boolean isOptional()
By default, return false.

Specified by:
isOptional in interface Artifact
See Also:
Artifact.isOptional()

setOptional

public void setOptional(boolean b)
By default, do nothing.

Specified by:
setOptional in interface Artifact
Parameters:
b -

getSelectedVersion

public ArtifactVersion getSelectedVersion()
                                   throws OverConstrainedVersionException
By default, return null.

Specified by:
getSelectedVersion in interface Artifact
Throws:
OverConstrainedVersionException
See Also:
Artifact.getSelectedVersion()

isSelectedVersionKnown

public boolean isSelectedVersionKnown()
                               throws OverConstrainedVersionException
By default, return false.

Specified by:
isSelectedVersionKnown in interface Artifact
Throws:
OverConstrainedVersionException
See Also:
Artifact.isSelectedVersionKnown()

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()


Copyright © 2002-2011 Apache Software Foundation. All Rights Reserved.