com.springsource.util.osgi.manifest.internal
Class StandardRequiredBundle

java.lang.Object
  extended by com.springsource.util.osgi.manifest.internal.BaseParameterised
      extended by com.springsource.util.osgi.manifest.internal.BaseCompoundHeaderEntry
          extended by com.springsource.util.osgi.manifest.internal.StandardRequiredBundle
All Implemented Interfaces:
Parameterised, Parseable, RequiredBundle

public class StandardRequiredBundle
extends BaseCompoundHeaderEntry
implements RequiredBundle

Concurrent Semantics
Not thread-safe.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.springsource.util.osgi.manifest.RequiredBundle
RequiredBundle.Visibility
 
Field Summary
 
Fields inherited from class com.springsource.util.osgi.manifest.internal.BaseParameterised
name
 
Constructor Summary
StandardRequiredBundle(HeaderParser parser, java.lang.String name)
           
 
Method Summary
 java.lang.String getBundleSymbolicName()
          Returns the symbolic name of the bundle that is required, never null.
 VersionRange getBundleVersion()
          Returns the value of the header's bundle-version attribute.
 Resolution getResolution()
          Returns the value of the entry's resolution directive.
 RequiredBundle.Visibility getVisibility()
          Returns the value of the entry's visibility directive.
(package private)  HeaderDeclaration parse(HeaderParser parser, java.lang.String parseString)
          
 void setBundleSymbolicName(java.lang.String bundleSymbolicName)
          Sets the symbolic name of the bundle that is required.
 void setBundleVersion(VersionRange versionRange)
          Sets the value of the header's bundle-version directive.
 void setResolution(Resolution resolution)
          Sets the value of the resolution directive.
 void setVisibility(RequiredBundle.Visibility visibility)
          Sets the value of the visibility directive.
 
Methods inherited from class com.springsource.util.osgi.manifest.internal.BaseParameterised
equals, getAttributes, getDirectives, hashCode, resetFromParseString, toParseString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.springsource.util.osgi.manifest.Parameterised
getAttributes, getDirectives
 
Methods inherited from interface com.springsource.util.osgi.manifest.Parseable
resetFromParseString, toParseString
 

Constructor Detail

StandardRequiredBundle

StandardRequiredBundle(HeaderParser parser,
                       java.lang.String name)
Method Detail

getBundleSymbolicName

public java.lang.String getBundleSymbolicName()
Description copied from interface: RequiredBundle
Returns the symbolic name of the bundle that is required, never null.

Specified by:
getBundleSymbolicName in interface RequiredBundle
Returns:
the required bundle's symbolic name.

getResolution

public Resolution getResolution()
Returns the value of the entry's resolution directive. If no such directive is specified, the default value of Resolution.MANDATORY is returned.

Specified by:
getResolution in interface RequiredBundle
Returns:
the value of the resolution directive

getVisibility

public RequiredBundle.Visibility getVisibility()
Returns the value of the entry's visibility directive. If no such directive is specified, the default value of RequiredBundle.Visibility.PRIVATE is returned.

Specified by:
getVisibility in interface RequiredBundle
Returns:
the value of the visibility directive

setBundleSymbolicName

public void setBundleSymbolicName(java.lang.String bundleSymbolicName)
Sets the symbolic name of the bundle that is required.

Specified by:
setBundleSymbolicName in interface RequiredBundle
Parameters:
bundleSymbolicName - the required bundle's symbolic name

setResolution

public void setResolution(Resolution resolution)
Sets the value of the resolution directive. If null is given, sets the value to Resolution.MANDATORY.

Specified by:
setResolution in interface RequiredBundle
Parameters:
resolution - The resolution directive

setVisibility

public void setVisibility(RequiredBundle.Visibility visibility)
Sets the value of the visibility directive. If null is given, sets the value to RequiredBundle.Visibility.PRIVATE.

Specified by:
setVisibility in interface RequiredBundle
Parameters:
visibility - The value of the visibility directive.

parse

HeaderDeclaration parse(HeaderParser parser,
                        java.lang.String parseString)

Specified by:
parse in class BaseParameterised

getBundleVersion

public VersionRange getBundleVersion()
Returns the value of the header's bundle-version attribute. If no such attribute is specified, returns the default version range of [0, infinity).

Specified by:
getBundleVersion in interface RequiredBundle
Returns:
the value of the bundle-version attribute.

setBundleVersion

public void setBundleVersion(VersionRange versionRange)
Sets the value of the header's bundle-version directive.

Specified by:
setBundleVersion in interface RequiredBundle
Parameters:
versionRange - the value for the bundle-version directive.