Package de.mnl.osgi.bnd.maven
Class MavenResourceRepository.MavenResourceImpl
- java.lang.Object
-
- de.mnl.osgi.bnd.maven.MavenResourceRepository.MavenResourceImpl
-
- All Implemented Interfaces:
MavenResource
- Enclosing class:
- MavenResourceRepository
public class MavenResourceRepository.MavenResourceImpl extends Object implements MavenResource
A maven resource that obtains its information lazily from aCompositeMavenRepository
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description aQute.maven.api.Archive
archive()
Returns the archive.Resource
asResource()
Gets the underlying "ordinary" resource.BoundArchive
boundArchive()
Returns the bound archive.List<org.apache.maven.model.Dependency>
dependencies()
Returns the mandatory maven compile and runtime dependencies.boolean
equals(Object obj)
Compares aMavenResource
with another maven resource or aResource
.List<Capability>
getCapabilities(String namespace)
Gets the capabilities from the given namespace.List<Requirement>
getRequirements(String namespace)
Gets the requirements from the given namespace.int
hashCode()
The hash code is defined by the revision.String
toString()
-
-
-
Method Detail
-
archive
public aQute.maven.api.Archive archive()
Description copied from interface:MavenResource
Returns the archive. The archive is the only mandatory information when creating aMavenResource
. The other informations that can be obtained can be made available lazily, i.e. can be loaded on demand.This implies that a
MavenResource
can be created that does not exist in the backing maven repositories. If not obvious from the context, a call toMavenResource.boundArchive()
can be used to verify that the resource exists.- Specified by:
archive
in interfaceMavenResource
- Returns:
- the archive
-
boundArchive
public BoundArchive boundArchive() throws MavenResourceException
Description copied from interface:MavenResource
Returns the bound archive. Implies looking up the archive in the backing repositories.- Specified by:
boundArchive
in interfaceMavenResource
- Returns:
- the bound archive
- Throws:
MavenResourceException
- if the archive cannot obtained from a repository
-
asResource
public Resource asResource() throws MavenResourceException
Description copied from interface:MavenResource
Gets the underlying "ordinary" resource.- Specified by:
asResource
in interfaceMavenResource
- Returns:
- the resource
- Throws:
MavenResourceException
- the maven resource exception
-
getCapabilities
public List<Capability> getCapabilities(String namespace) throws MavenResourceException
Description copied from interface:MavenResource
Gets the capabilities from the given namespace.- Specified by:
getCapabilities
in interfaceMavenResource
- Parameters:
namespace
- the namespace- Returns:
- the capabilities
- Throws:
MavenResourceException
- the maven resource exception
-
getRequirements
public List<Requirement> getRequirements(String namespace) throws MavenResourceException
Description copied from interface:MavenResource
Gets the requirements from the given namespace.- Specified by:
getRequirements
in interfaceMavenResource
- Parameters:
namespace
- the namespace- Returns:
- the requirements
- Throws:
MavenResourceException
- the maven resource exception
-
equals
public boolean equals(Object obj)
Description copied from interface:MavenResource
Compares aMavenResource
with another maven resource or aResource
.Two
MavenResource
s are considered equal if their archives are equal. If aMavenResource
is compared with anotherResource
, equality will be checked betweenMavenResource.asResource()
and the other resource (seeResource.equals(Object)
).- Specified by:
equals
in interfaceMavenResource
- Overrides:
equals
in classObject
- Parameters:
obj
- the object to compare with- Returns:
- true, if successful
-
hashCode
public int hashCode()
Description copied from interface:MavenResource
The hash code is defined by the revision.- Specified by:
hashCode
in interfaceMavenResource
- Overrides:
hashCode
in classObject
- Returns:
- the int
-
toString
public String toString()
- Specified by:
toString
in interfaceMavenResource
- Overrides:
toString
in classObject
-
dependencies
public final List<org.apache.maven.model.Dependency> dependencies() throws MavenResourceException
Description copied from interface:MavenResource
Returns the mandatory maven compile and runtime dependencies. Dependencies in the POM that use variables are filtered, because these variable cannot be resolved.- Specified by:
dependencies
in interfaceMavenResource
- Returns:
- the dependencies
- Throws:
MavenResourceException
- the maven resource exception
-
-