org.eclipse.osgi.internal.resolver
Class ImportPackageSpecificationImpl

java.lang.Object
  extended by org.eclipse.osgi.internal.resolver.ImportPackageSpecificationImpl
All Implemented Interfaces:
Cloneable, ImportPackageSpecification, VersionConstraint

public class ImportPackageSpecificationImpl
extends Object
implements ImportPackageSpecification


Field Summary
protected  Object monitor
           
 
Fields inherited from interface org.eclipse.osgi.service.resolver.ImportPackageSpecification
RESOLUTION_DYNAMIC, RESOLUTION_OPTIONAL, RESOLUTION_STATIC
 
Constructor Summary
ImportPackageSpecificationImpl()
           
 
Method Summary
 Map<String,Object> getAttributes()
          Returns the arbitrary attributes which this import package may be resolved to.
 BundleDescription getBundle()
          Returns the bundle that declares this constraint.
 String getBundleSymbolicName()
          Returns the symbolic name of the bundle this import package must be resolved to.
 VersionRange getBundleVersionRange()
          Returns the version range which this import package may be resolved to.
 Object getDirective(String key)
          Returns the specified directive that control this import package.
 Map<String,Object> getDirectives()
          Returns the directives that control this import package.
protected  Map<String,Object> getInteralAttributes()
           
protected  Map<String,String> getInternalDirectives()
           
protected  String getInternalNameSpace()
           
 String getName()
          Returns this constraint's name.
 BundleRequirement getRequirement()
          Returns the requirement represented by this constraint.
 BaseDescription getSupplier()
          Returns the supplier that satisfies this constraint, if it is resolved.
 Object getUserObject()
          Returns the user object associated to this constraint, or null if none exists.
 VersionRange getVersionRange()
          Returns the version range for this constraint.
protected  boolean hasMandatoryAttributes(String[] mandatory)
           
 boolean isResolved()
          Returns whether this constraint is resolved.
 boolean isSatisfiedBy(BaseDescription supplier)
          Returns whether this constraint could be satisfied by the given supplier.
 boolean isSatisfiedBy(BaseDescription supplier, boolean checkEE)
           
protected  void setAttributes(Map<String,?> attributes)
           
protected  void setBundle(BundleDescription bundle)
           
protected  void setBundleSymbolicName(String symbolicName)
           
protected  void setBundleVersionRange(VersionRange bundleVersionRange)
           
protected  void setName(String name)
           
protected  void setSupplier(BaseDescription supplier)
           
 void setUserObject(Object userObject)
          Associates a user-provided object to this constraint, or removes an existing association, if null is provided.
protected  void setVersionRange(VersionRange versionRange)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.eclipse.osgi.service.resolver.VersionConstraint
getBundle, getName, getRequirement, getSupplier, getUserObject, getVersionRange, isResolved, setUserObject
 

Field Detail

monitor

protected final Object monitor
Constructor Detail

ImportPackageSpecificationImpl

public ImportPackageSpecificationImpl()
Method Detail

getDirectives

public Map<String,Object> getDirectives()
Description copied from interface: ImportPackageSpecification
Returns the directives that control this import package.

Specified by:
getDirectives in interface ImportPackageSpecification
Returns:
the directives that control this import package.

getDirective

public Object getDirective(String key)
Description copied from interface: ImportPackageSpecification
Returns the specified directive that control this import package.

Specified by:
getDirective in interface ImportPackageSpecification
Returns:
the specified directive that control this import package.

getBundleSymbolicName

public String getBundleSymbolicName()
Description copied from interface: ImportPackageSpecification
Returns the symbolic name of the bundle this import package must be resolved to.

Specified by:
getBundleSymbolicName in interface ImportPackageSpecification
Returns:
the symbolic name of the bundle this import pacakge must be resolved to. A value of null indicates any symbolic name.

getBundleVersionRange

public VersionRange getBundleVersionRange()
Description copied from interface: ImportPackageSpecification
Returns the version range which this import package may be resolved to.

Specified by:
getBundleVersionRange in interface ImportPackageSpecification
Returns:
the version range which this import package may be resolved to.

getAttributes

public Map<String,Object> getAttributes()
Description copied from interface: ImportPackageSpecification
Returns the arbitrary attributes which this import package may be resolved to.

Specified by:
getAttributes in interface ImportPackageSpecification
Returns:
the arbitrary attributes which this import package may be resolved to.

isSatisfiedBy

public boolean isSatisfiedBy(BaseDescription supplier)
Description copied from interface: VersionConstraint
Returns whether this constraint could be satisfied by the given supplier. This will depend on the suppliers different attributes including its name, versions and other arbitrary attributes

Specified by:
isSatisfiedBy in interface VersionConstraint
Parameters:
supplier - a supplier to be tested against this constraint (may be null)
Returns:
true if this constraint could be resolved using the supplier, false otherwise

isSatisfiedBy

public boolean isSatisfiedBy(BaseDescription supplier,
                             boolean checkEE)

hasMandatoryAttributes

protected boolean hasMandatoryAttributes(String[] mandatory)

setBundleSymbolicName

protected void setBundleSymbolicName(String symbolicName)

setBundleVersionRange

protected void setBundleVersionRange(VersionRange bundleVersionRange)

setAttributes

protected void setAttributes(Map<String,?> attributes)

toString

public String toString()
Overrides:
toString in class Object

getInternalDirectives

protected Map<String,String> getInternalDirectives()

getInteralAttributes

protected Map<String,Object> getInteralAttributes()

getInternalNameSpace

protected String getInternalNameSpace()

getName

public String getName()
Description copied from interface: VersionConstraint
Returns this constraint's name.

Specified by:
getName in interface VersionConstraint
Returns:
this constraint's name

getVersionRange

public VersionRange getVersionRange()
Description copied from interface: VersionConstraint
Returns the version range for this constraint.

Specified by:
getVersionRange in interface VersionConstraint
Returns:
the version range for this constraint, or null

getBundle

public BundleDescription getBundle()
Description copied from interface: VersionConstraint
Returns the bundle that declares this constraint.

Specified by:
getBundle in interface VersionConstraint
Returns:
a bundle description

isResolved

public boolean isResolved()
Description copied from interface: VersionConstraint
Returns whether this constraint is resolved. A resolved constraint is guaranteed to have its supplier defined.

Specified by:
isResolved in interface VersionConstraint
Returns:
true if this bundle is resolved, false otherwise

getSupplier

public BaseDescription getSupplier()
Description copied from interface: VersionConstraint
Returns the supplier that satisfies this constraint, if it is resolved.

Specified by:
getSupplier in interface VersionConstraint
Returns:
a supplier, or null
See Also:
VersionConstraint.isResolved()

setName

protected void setName(String name)

setVersionRange

protected void setVersionRange(VersionRange versionRange)

setBundle

protected void setBundle(BundleDescription bundle)

setSupplier

protected void setSupplier(BaseDescription supplier)

getRequirement

public BundleRequirement getRequirement()
Description copied from interface: VersionConstraint
Returns the requirement represented by this constraint. Some constraint types may not be able to represent a requirement. In such cases null is returned.

Specified by:
getRequirement in interface VersionConstraint
Returns:
the requirement represented by this constraint

getUserObject

public Object getUserObject()
Description copied from interface: VersionConstraint
Returns the user object associated to this constraint, or null if none exists.

Specified by:
getUserObject in interface VersionConstraint
Returns:
the user object associated to this constraint, or null

setUserObject

public void setUserObject(Object userObject)
Description copied from interface: VersionConstraint
Associates a user-provided object to this constraint, or removes an existing association, if null is provided. The provided object is not interpreted in any ways by this constrain.

Specified by:
setUserObject in interface VersionConstraint
Parameters:
userObject - an arbitrary object provided by the user, or null


Copyright © 2007–2014 The Apache Software Foundation. All rights reserved.