org.codehaus.mojo.versions.api
Class PropertyVersions

java.lang.Object
  extended by org.codehaus.mojo.versions.api.AbstractVersionDetails
      extended by org.codehaus.mojo.versions.api.PropertyVersions
All Implemented Interfaces:
VersionDetails

public class PropertyVersions
extends AbstractVersionDetails

Manages a property that is associated with one or more artifacts.

Since:
1.0-alpha-3
Author:
Stephen Connolly

Method Summary
 ArtifactAssociation[] getAssociations()
           
 String getName()
           
 org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(String currentVersion, Property property, Boolean allowSnapshots, List reactorProjects, VersionsHelper helper)
           
 String getProfileId()
           
 VersionComparator getVersionComparator()
          Gets the rule for version comparison of this artifact.
 org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(boolean includeSnapshots)
          Uses the DefaultVersionsHelper to find all available versions that match all the associations with this property.
 org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(Collection artifacts)
          Uses the supplied Collection of Artifact instances to see if an ArtifactVersion can be provided.
 boolean isAssociated()
           
 String toString()
           
 
Methods inherited from class org.codehaus.mojo.versions.api.AbstractVersionDetails
containsVersion, getAllUpdates, getAllUpdates, getAllUpdates, getAllUpdates, getAllUpdates, getAllUpdates, getAllUpdates, getAllUpdates, getCurrentVersion, getNewerVersions, getNewestUpdate, getNewestUpdate, getNewestUpdate, getNewestUpdate, getNewestUpdate, getNewestUpdate, getNewestUpdate, getNewestUpdate, getNewestVersion, getNewestVersion, getNewestVersion, getNewestVersion, getNewestVersion, getOldestUpdate, getOldestUpdate, getOldestUpdate, getOldestUpdate, getOldestUpdate, getOldestUpdate, getOldestUpdate, getOldestUpdate, getOldestVersion, getOldestVersion, getOldestVersion, getOldestVersion, getOldestVersion, getVersions, getVersions, getVersions, getVersions, getVersions, getVersions, isCurrentVersionDefined, isIncludeSnapshots, setCurrentVersion, setCurrentVersion, setIncludeSnapshots
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getVersionComparator

public VersionComparator getVersionComparator()
Gets the rule for version comparison of this artifact.

Returns:
the rule for version comparison of this artifact.
Since:
1.0-beta-1

getAssociations

public ArtifactAssociation[] getAssociations()

getVersions

public org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(Collection artifacts)
                                                                   throws org.apache.maven.plugin.MojoExecutionException
Uses the supplied Collection of Artifact instances to see if an ArtifactVersion can be provided.

Parameters:
artifacts - The Collection of Artifact instances .
Returns:
The versions that can be resolved from the supplied Artifact instances or an empty array if no version can be resolved (i.e. the property is not associated with any of the supplied artifacts or the property is also associated to an artifact that has not been provided).
Throws:
org.apache.maven.plugin.MojoExecutionException - When things go wrong.
Since:
1.0-alpha-3

getVersions

public org.apache.maven.artifact.versioning.ArtifactVersion[] getVersions(boolean includeSnapshots)
Uses the DefaultVersionsHelper to find all available versions that match all the associations with this property.

Specified by:
getVersions in interface VersionDetails
Specified by:
getVersions in class AbstractVersionDetails
Parameters:
includeSnapshots - Whether to include snapshot versions in our search.
Returns:
The (possibly empty) array of versions.

getName

public String getName()

getProfileId

public String getProfileId()

isAssociated

public boolean isAssociated()

toString

public String toString()
Overrides:
toString in class Object

getNewestVersion

public org.apache.maven.artifact.versioning.ArtifactVersion getNewestVersion(String currentVersion,
                                                                             Property property,
                                                                             Boolean allowSnapshots,
                                                                             List reactorProjects,
                                                                             VersionsHelper helper)
                                                                      throws org.apache.maven.plugin.MojoExecutionException
Throws:
org.apache.maven.plugin.MojoExecutionException


Copyright © 2008-2011 Codehaus. All Rights Reserved.