org.ops4j.pax.exam.options
Class MavenArtifactUrlReference

java.lang.Object
  extended by org.ops4j.pax.exam.options.MavenArtifactUrlReference
All Implemented Interfaces:
MavenUrlReference, UrlReference

public class MavenArtifactUrlReference
extends java.lang.Object
implements MavenUrlReference

Option specifying a maven url (Pax URL mvn: handler).

Since:
0.5.0, April 25, 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
MavenArtifactUrlReference()
           
 
Method Summary
 MavenArtifactUrlReference artifactId(java.lang.String artifactId)
          Sets the artifact id.
 MavenUrlReference classifier(java.lang.String classifier)
          Sets the artifact classifier.
 java.lang.String getURL()
          Getter.
 MavenArtifactUrlReference 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.
 java.lang.String toString()
          
 MavenArtifactUrlReference type(java.lang.String type)
          Sets the artifact type.
 MavenArtifactUrlReference version(MavenUrlReference.VersionResolver resolver)
          Determines the artifact version using an MavenUrlReference.VersionResolver.
 MavenArtifactUrlReference version(java.lang.String version)
          Sets the artifact version or version range.
 MavenArtifactUrlReference versionAsInProject()
          Version will be discovered from the dependencies of Maven project that includes the test.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MavenArtifactUrlReference

public MavenArtifactUrlReference()
Method Detail

groupId

public MavenArtifactUrlReference 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 MavenArtifactUrlReference 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 MavenArtifactUrlReference 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 MavenUrlReference 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 MavenArtifactUrlReference 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 MavenArtifactUrlReference 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 MavenArtifactUrlReference 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)
Throws:
java.lang.IllegalArgumentException - - If group id is null or empty - If artifact id is null or empty

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object


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