org.osgi.service.indexer
Class Builder
java.lang.Object
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.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Builder
public Builder()
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 namevalue - attribute value
- Returns:
- this
addDirective
public Builder addDirective(java.lang.String name,
java.lang.String value)
- Add a directive
- Parameters:
name - directive namevalue - 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