org.osgi.framework.resource
Interface Requirement

All Known Subinterfaces:
BundleRequirement
All Known Implementing Classes:
HostedRequirement

public interface Requirement

A requirement that has been declared from a Resource .

Version:
$Id: 46f600c32e563cfe617fb94ab4e308f5be2b9217 $

Method Summary
 java.util.Map<java.lang.String,java.lang.Object> getAttributes()
          Returns the attributes of this requirement.
 java.util.Map<java.lang.String,java.lang.String> getDirectives()
          Returns the directives of this requirement.
 java.lang.String getNamespace()
          Returns the name space of this requirement.
 Resource getResource()
          Returns the resource declaring this requirement.
 boolean matches(Capability capability)
          Returns whether the specified capability matches this requirement.
 

Method Detail

getNamespace

java.lang.String getNamespace()
Returns the name space of this requirement.

Returns:
The name space of this requirement.

getDirectives

java.util.Map<java.lang.String,java.lang.String> getDirectives()
Returns the directives of this requirement.

Only the following list of directives have specified semantics:

All other directives have no specified semantics and are considered extra user defined information. The OSGi Alliance reserves the right to extend the set of directives which have specified semantics.

Returns:
An unmodifiable map of directive names to directive values for this requirement, or an empty map if this requirement has no directives.

getAttributes

java.util.Map<java.lang.String,java.lang.Object> getAttributes()
Returns the attributes of this requirement.

Requirement attributes have no specified semantics and are considered extra user defined information.

Returns:
An unmodifiable map of attribute names to attribute values for this requirement, or an empty map if this requirement has no attributes.

getResource

Resource getResource()
Returns the resource declaring this requirement.

Returns:
The resource declaring this requirement.

matches

boolean matches(Capability capability)
Returns whether the specified capability matches this requirement.

A capability matches this requirement when all of the following are true:

Parameters:
capability - The capability to match to this requirement.
Returns:
true if the specified capability matches this this requirement; false otherwise.


Copyright © 2006-2012 The Apache Software Foundation. All Rights Reserved.