Knopflerfish OSGi 5.2.0

org.osgi.service.indexer
Class Builder

java.lang.Object
  extended by org.osgi.service.indexer.Builder

public class Builder
extends java.lang.Object

A container for attributes and directives under a certain namespace. Can generate a capability and/or a requirement from the contained information.


Constructor Summary
Builder()
           
 
Method Summary
 Builder addAttribute(java.lang.String name, java.lang.Object value)
          Add an attribute
 Builder addDirective(java.lang.String name, java.lang.String value)
          Add a directive
 Capability buildCapability()
           
 Requirement buildRequirement()
           
 Builder setNamespace(java.lang.String namespace)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Builder

public Builder()
Method Detail

setNamespace

public Builder setNamespace(java.lang.String namespace)
Parameters:
namespace - the namespace to set
Returns:
this

addAttribute

public Builder addAttribute(java.lang.String name,
                            java.lang.Object value)
Add an attribute

Parameters:
name - attribute name
value - attribute value
Returns:
this

addDirective

public Builder addDirective(java.lang.String name,
                            java.lang.String value)
Add a directive

Parameters:
name - directive name
value - directive value
Returns:
this

buildCapability

public Capability buildCapability()
                           throws java.lang.IllegalStateException
Returns:
a new capability, constructed from the namespace, attributes and directives
Throws:
java.lang.IllegalStateException - when the namespace isn't set

buildRequirement

public Requirement buildRequirement()
                             throws java.lang.IllegalStateException
Returns:
a new requirement, constructed from the namespace, attributes and directives
Throws:
java.lang.IllegalStateException - when the namespace isn't set

Knopflerfish OSGi 5.2.0