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.Archivearchive()Returns the archive.ResourceasResource()Gets the underlying "ordinary" resource.BoundArchiveboundArchive()Returns the bound archive.List<org.apache.maven.model.Dependency>dependencies()Returns the mandatory maven compile and runtime dependencies.booleanequals(Object obj)Compares aMavenResourcewith 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.inthashCode()The hash code is defined by the revision.StringtoString()
-
-
-
Method Detail
-
archive
public aQute.maven.api.Archive archive()
Description copied from interface:MavenResourceReturns 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
MavenResourcecan 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:
archivein interfaceMavenResource- Returns:
- the archive
-
boundArchive
public BoundArchive boundArchive() throws MavenResourceException
Description copied from interface:MavenResourceReturns the bound archive. Implies looking up the archive in the backing repositories.- Specified by:
boundArchivein 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:MavenResourceGets the underlying "ordinary" resource.- Specified by:
asResourcein interfaceMavenResource- Returns:
- the resource
- Throws:
MavenResourceException- the maven resource exception
-
getCapabilities
public List<Capability> getCapabilities(String namespace) throws MavenResourceException
Description copied from interface:MavenResourceGets the capabilities from the given namespace.- Specified by:
getCapabilitiesin 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:MavenResourceGets the requirements from the given namespace.- Specified by:
getRequirementsin interfaceMavenResource- Parameters:
namespace- the namespace- Returns:
- the requirements
- Throws:
MavenResourceException- the maven resource exception
-
equals
public boolean equals(Object obj)
Description copied from interface:MavenResourceCompares aMavenResourcewith another maven resource or aResource.Two
MavenResources are considered equal if their archives are equal. If aMavenResourceis compared with anotherResource, equality will be checked betweenMavenResource.asResource()and the other resource (seeResource.equals(Object)).- Specified by:
equalsin interfaceMavenResource- Overrides:
equalsin classObject- Parameters:
obj- the object to compare with- Returns:
- true, if successful
-
hashCode
public int hashCode()
Description copied from interface:MavenResourceThe hash code is defined by the revision.- Specified by:
hashCodein interfaceMavenResource- Overrides:
hashCodein classObject- Returns:
- the int
-
toString
public String toString()
- Specified by:
toStringin interfaceMavenResource- Overrides:
toStringin classObject
-
dependencies
public final List<org.apache.maven.model.Dependency> dependencies() throws MavenResourceException
Description copied from interface:MavenResourceReturns the mandatory maven compile and runtime dependencies. Dependencies in the POM that use variables are filtered, because these variable cannot be resolved.- Specified by:
dependenciesin interfaceMavenResource- Returns:
- the dependencies
- Throws:
MavenResourceException- the maven resource exception
-
-