org.apache.felix.ipojo.handlers.dependency

## Class DependencyDescription

- java.lang.Object
- - org.apache.felix.ipojo.handlers.dependency.DependencyDescription

    public class DependencyDescription
    extends java.lang.Object

Service Dependency Description.

Author:
  Felix Project Team

### Constructor Summary

Constructors
Constructor and Description
`DependencyDescription(Dependency dep)` Creates a dependency description.

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `addListener(DependencyModelListener listener)` Add the given listener to the dependency model's list of listeners.
`java.lang.String` `getComparator()`
`java.lang.String` `getDefaultImplementation()`
`Dependency` `getDependency()` Gets the described dependency.
`java.lang.String` `getFilter()`
`java.lang.String` `getId()`
`java.lang.String` `getInterface()`
`int` `getPolicy()`
`org.osgi.framework.ServiceReference` `getServiceReference()` Gets the service reference if only one service reference is used.
`java.util.List<org.osgi.framework.ServiceReference>` `getServiceReferences()` Gets the service reference list.
`java.lang.String` `getSpecification()` Gets the required service specification name.
`int` `getState()`
`java.util.List<org.osgi.framework.ServiceReference>` `getUsedServices()` Gets the used service set.
`boolean` `isFrozen()`
`boolean` `isMultiple()`
`boolean` `isOptional()`
`boolean` `isProxy()`
`void` `removeListener(DependencyModelListener listener)` Remove the given listener from the dependency model's list of listeners.
`void` `setAggregate(boolean isAgg)` Sets the dependency cardinality.
`void` `setComparator(java.util.Comparator cmp)` Sets the dependency comparator.
`void` `setFilter(org.osgi.framework.Filter filter)` Sets the dependency filter.
`void` `setOptional(boolean isOpt)` Sets the dependency optionality.
`boolean` `supportsNullable()` Gets `true` if the dependency uses Nullable objects.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### DependencyDescription

    public DependencyDescription(Dependency dep)

Creates a dependency description.

Parameters:
  `dep` - the described dependency

### Method Detail

#### isMultiple

    public boolean isMultiple()

#### isOptional

    public boolean isOptional()

#### getFilter

    public java.lang.String getFilter()

#### getInterface

    public java.lang.String getInterface()

#### getState

    public int getState()

#### getId

    public java.lang.String getId()

#### isProxy

    public boolean isProxy()

#### supportsNullable

    public boolean supportsNullable()

Gets `true` if the dependency uses Nullable objects.

Returns:
  true if the dependency is optional and supports nullable object.

#### getDefaultImplementation

    public java.lang.String getDefaultImplementation()

#### getPolicy

    public int getPolicy()

#### getComparator

    public java.lang.String getComparator()

#### isFrozen

    public boolean isFrozen()

#### getServiceReferences

    public java.util.List<org.osgi.framework.ServiceReference> getServiceReferences()

Gets the service reference list.

Returns:
  the list of matching service reference, `null` if no service reference.

#### getServiceReference

    public org.osgi.framework.ServiceReference getServiceReference()

Gets the service reference if only one service reference is used.

Returns:
  the ServiceReference (only if the cardinality could be 1), or `null` if no service reference.

#### getUsedServices

    public java.util.List<org.osgi.framework.ServiceReference> getUsedServices()

Gets the used service set.

Returns:
  the list [service reference] containing the used services, `null` if no providers are used

#### setComparator

    public void setComparator(java.util.Comparator cmp)

Sets the dependency comparator. The reference set will be sort at the next usage.

Parameters:
  `cmp` - the comparator

#### setFilter

    public void setFilter(org.osgi.framework.Filter filter)

Sets the dependency filter.

Parameters:
  `filter` - the new LDAP filter

#### setAggregate

    public void setAggregate(boolean isAgg)

Sets the dependency cardinality.

Parameters:
  `isAgg` - if `true` sets the dependency to aggregate, if `false` sets the dependency to scalar.

#### setOptional

    public void setOptional(boolean isOpt)

Sets the dependency optionality.

Parameters:
  `isOpt` - if `true` sets the dependency to optional, if `false` sets the dependency to mandatory.

#### getSpecification

    public java.lang.String getSpecification()

Gets the required service specification name.

Returns:
  the required service specification class name.

#### getDependency

    public Dependency getDependency()

Gets the described dependency.

Returns:
  the dependency.

#### addListener

    public void addListener(DependencyModelListener listener)

Add the given listener to the dependency model's list of listeners.

Parameters:
  `listener` - the `DependencyModelListener` object to be added
Throws:
  `java.lang.NullPointerException` - if `listener` is `null`

#### removeListener

    public void removeListener(DependencyModelListener listener)

Remove the given listener from the dependency model's list of listeners.

Parameters:
  `listener` - the `DependencyModelListener` object to be removed
Throws:
  `java.lang.NullPointerException` - if `listener` is `null`
  `java.util.NoSuchElementException` - if `listener` wasn't present in the dependency model's list of listeners