org.ops4j.pax.exam.options
Class MavenArtifactProvisionOption

java.lang.Object
  extended by org.ops4j.pax.exam.options.AbstractProvisionControl<T>
      extended by org.ops4j.pax.exam.options.AbstractProvisionOption<MavenArtifactProvisionOption>
          extended by org.ops4j.pax.exam.options.MavenArtifactProvisionOption
All Implemented Interfaces:
Option, MavenUrlReference, ProvisionControl<MavenArtifactProvisionOption>, ProvisionOption<MavenArtifactProvisionOption>, UrlReference

public class MavenArtifactProvisionOption
extends AbstractProvisionOption<MavenArtifactProvisionOption>
implements MavenUrlReference

Option specifying provisioning from an maven url (Pax URL mvn: handler).

Since:
0.3.0, December 08, 2008
Author:
Alin Dreghiciu (adreghiciu@gmail.com)

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.ops4j.pax.exam.options.MavenUrlReference
MavenUrlReference.VersionResolver
 
Constructor Summary
MavenArtifactProvisionOption()
          Constructor.
MavenArtifactProvisionOption(MavenUrlReference artifact)
          Constructor based on a mevn artifact option.
 
Method Summary
 MavenArtifactProvisionOption artifactId(java.lang.String artifactId)
          Sets the artifact id.
 MavenArtifactProvisionOption classifier(java.lang.String classifier)
          Sets the artifact classifier.
 java.lang.String getURL()
          Getter.
 MavenArtifactProvisionOption groupId(java.lang.String groupId)
          Sets the artifact group id.
 java.lang.Boolean isSnapshot()
          Returns true if the specified version is a snapshot version, false if not and null if the version is not yet specified.
protected  MavenArtifactProvisionOption itself()
          Implemented by sub classes in order to return itself (this) for fluent api usage
 boolean shouldUpdate()
          If the provisioned bundle(s) should be updated (re-downloaded).
 java.lang.String toString()
          
 MavenArtifactProvisionOption type(java.lang.String type)
          Sets the artifact type.
 MavenArtifactProvisionOption update(java.lang.Boolean shouldUpdate)
          Setter.
 MavenArtifactProvisionOption version(MavenUrlReference.VersionResolver resolver)
          Determines the artifact version using an MavenUrlReference.VersionResolver.
 MavenArtifactProvisionOption version(java.lang.String version)
          Sets the artifact version or version range.
 MavenArtifactProvisionOption versionAsInProject()
          Version will be discovered from the dependencies of Maven project that includes the test.
 
Methods inherited from class org.ops4j.pax.exam.options.AbstractProvisionControl
getStartLevel, noStart, noUpdate, shouldStart, start, start, startLevel, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.ops4j.pax.exam.options.ProvisionControl
getStartLevel, noStart, noUpdate, shouldStart, start, start, startLevel, update
 

Constructor Detail

MavenArtifactProvisionOption

public MavenArtifactProvisionOption()
Constructor.


MavenArtifactProvisionOption

public MavenArtifactProvisionOption(MavenUrlReference artifact)
Constructor based on a mevn artifact option.

Parameters:
artifact - maven artifact (cannot be null)
Method Detail

groupId

public MavenArtifactProvisionOption groupId(java.lang.String groupId)
Sets the artifact group id.

Specified by:
groupId in interface MavenUrlReference
Parameters:
groupId - artifact group id (cannot be null or empty)
Returns:
itself, for fluent api usage

artifactId

public MavenArtifactProvisionOption artifactId(java.lang.String artifactId)
Sets the artifact id.

Specified by:
artifactId in interface MavenUrlReference
Parameters:
artifactId - artifact id (cannot be null or empty)
Returns:
itself, for fluent api usage

type

public MavenArtifactProvisionOption type(java.lang.String type)
Sets the artifact type. Do not set the value (use this method) if default artifact type should be used.

Specified by:
type in interface MavenUrlReference
Parameters:
type - artifact type (cannot be null or empty)
Returns:
itself, for fluent api usage

classifier

public MavenArtifactProvisionOption classifier(java.lang.String classifier)
Sets the artifact classifier.

Specified by:
classifier in interface MavenUrlReference
Parameters:
classifier - artifact classifier (cannot be null or empty)
Returns:
itself, for fluent api usage

version

public MavenArtifactProvisionOption version(java.lang.String version)
Sets the artifact version or version range. If version is a SNAPSHOT version the bundle will be set to updatable, otherwise the bundle will not be updated. This handling happens only if the user dows not use the update() by itself (see org.ops4j.pax.exam.options.ProvisionOption#update(boolean)).

Specified by:
version in interface MavenUrlReference
Parameters:
version - artifact version / version range (cannot be null or empty)
Returns:
itself, for fluent api usage

version

public MavenArtifactProvisionOption version(MavenUrlReference.VersionResolver resolver)
Determines the artifact version using an MavenUrlReference.VersionResolver.

Specified by:
version in interface MavenUrlReference
Parameters:
resolver - a MavenUrlReference.VersionResolver (cannot be null)
Returns:
itself, for fluent api usage

versionAsInProject

public MavenArtifactProvisionOption versionAsInProject()
Version will be discovered from the dependencies of Maven project that includes the test.

Specified by:
versionAsInProject in interface MavenUrlReference
Returns:
itself, for fluent api usage

isSnapshot

public java.lang.Boolean isSnapshot()
Returns true if the specified version is a snapshot version, false if not and null if the version is not yet specified.

Specified by:
isSnapshot in interface MavenUrlReference
Returns:
true if the specified version is a snapshot version, false if not and null if the version is not yet specified.

getURL

public java.lang.String getURL()
Getter.

Specified by:
getURL in interface UrlReference
Returns:
url (cannot be null)

update

public MavenArtifactProvisionOption update(java.lang.Boolean shouldUpdate)
Setter. Keep track if the user used the update method, so we do not override the value when handling automatic update on SNAPSHOT versions.

Specified by:
update in interface ProvisionControl<MavenArtifactProvisionOption>
Overrides:
update in class AbstractProvisionControl<MavenArtifactProvisionOption>
Parameters:
shouldUpdate - true if the provisioned bundle(s) should be updated, false otherwise
Returns:
itself, for fluent api usage

shouldUpdate

public boolean shouldUpdate()
Description copied from class: AbstractProvisionControl
If the provisioned bundle(s) should be updated (re-downloaded). By default bundles should be updated.

Specified by:
shouldUpdate in interface ProvisionControl<MavenArtifactProvisionOption>
Overrides:
shouldUpdate in class AbstractProvisionControl<MavenArtifactProvisionOption>
Returns:
true if the bundle(s) should be updated, false otherwise.

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

itself

protected MavenArtifactProvisionOption itself()
Implemented by sub classes in order to return itself (this) for fluent api usage

Specified by:
itself in class AbstractProvisionControl<MavenArtifactProvisionOption>
Returns:
itself


Copyright © 2006-2012 OPS4J - Open Participation Software for Java. All Rights Reserved.