public class MutableBundleManifest
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.util.List<ManifestAttribute> |
attributes |
private java.lang.String |
lineEnding |
private java.lang.String |
unparsed |
Constructor and Description |
---|
MutableBundleManifest() |
Modifier and Type | Method and Description |
---|---|
void |
add(ManifestAttribute attribute) |
private ManifestAttribute |
getAttribute(java.lang.String name) |
java.util.Map<java.lang.String,java.lang.String> |
getExportedPackagesVersion()
Get a map containing the name of packages in Export-Package manifest attribute as a map.
|
java.lang.String |
getFragmentHostSymbolicName() |
java.lang.String |
getFragmentHostVersion() |
java.util.Map<java.lang.String,java.lang.String> |
getImportPackagesVersions()
Get a map containing the name of packages in Import-Package manifest attribute as a map.
|
java.util.Map<java.lang.String,java.lang.String> |
getRequiredBundleVersions()
Read the RequiredBundle with optional versions
|
java.lang.String |
getSymbolicName() |
java.lang.String |
getVersion() |
boolean |
isFragment() |
private org.eclipse.osgi.util.ManifestElement[] |
parseHeader(java.lang.String name) |
private java.util.List<MutableManifestElement> |
parseHeaderForMutation(java.lang.String name) |
static MutableBundleManifest |
read(java.io.File file) |
static MutableBundleManifest |
read(java.io.InputStream is) |
private static java.lang.String |
readLineWithLineEnding(java.io.PushbackReader reader,
MutableBundleManifest mf) |
void |
setFragmentHostVersion(java.lang.String newVersion) |
private void |
setLineEndingWhenFirstLine(java.lang.String lineEnding) |
private void |
setUnparsed(java.lang.String unparsed) |
void |
setVersion(java.lang.String version) |
void |
updateExportedPackageVersions(java.util.Map<java.lang.String,java.lang.String> versionsToUpdate)
Updates version for packages in Export-Package with the version provided in the map.
|
void |
updateImportedPackageVersions(java.util.Map<java.lang.String,java.lang.String> versionsToUpdate)
Updates version range for packages in Import-Package with the version provided in the map.
|
void |
updateRequiredBundleVersions(java.util.Map<java.lang.String,java.lang.String> versionsToUpdate)
Updates version range for bundles in Require-Bundle with the versions provided in the map.
|
static void |
write(MutableBundleManifest mf,
java.io.File file) |
static void |
write(MutableBundleManifest mf,
java.io.OutputStream os) |
private final java.util.List<ManifestAttribute> attributes
private java.lang.String lineEnding
private java.lang.String unparsed
public void add(ManifestAttribute attribute)
public static MutableBundleManifest read(java.io.File file) throws java.io.IOException
java.io.IOException
public static MutableBundleManifest read(java.io.InputStream is) throws java.io.IOException
java.io.IOException
private static java.lang.String readLineWithLineEnding(java.io.PushbackReader reader, MutableBundleManifest mf) throws java.io.IOException
java.io.IOException
private void setLineEndingWhenFirstLine(java.lang.String lineEnding)
private void setUnparsed(java.lang.String unparsed)
public static void write(MutableBundleManifest mf, java.io.File file) throws java.io.IOException
java.io.IOException
public static void write(MutableBundleManifest mf, java.io.OutputStream os) throws java.io.IOException
java.io.IOException
public java.lang.String getSymbolicName()
public java.lang.String getVersion()
public java.lang.String getFragmentHostSymbolicName()
public boolean isFragment()
public java.lang.String getFragmentHostVersion()
public void setFragmentHostVersion(java.lang.String newVersion)
public java.util.Map<java.lang.String,java.lang.String> getRequiredBundleVersions()
public void updateRequiredBundleVersions(java.util.Map<java.lang.String,java.lang.String> versionsToUpdate)
versionsToUpdate
- the bundle/version-range map. Keys are the bundle symbolicnames to update and the
values are the new version range to apply.public java.util.Map<java.lang.String,java.lang.String> getImportPackagesVersions()
The map keys are the package names and the values are the version range if present or null when absent.
public void updateImportedPackageVersions(java.util.Map<java.lang.String,java.lang.String> versionsToUpdate)
versionsToUpdate
- the package/version-range map. Keys are the package names to update and the values
are the new version range to apply.public java.util.Map<java.lang.String,java.lang.String> getExportedPackagesVersion()
public void updateExportedPackageVersions(java.util.Map<java.lang.String,java.lang.String> versionsToUpdate)
versionsToUpdate
- the package/version map. Keys are the package names to update and the values are
the newVersion to apply.private org.eclipse.osgi.util.ManifestElement[] parseHeader(java.lang.String name)
private java.util.List<MutableManifestElement> parseHeaderForMutation(java.lang.String name)
private ManifestAttribute getAttribute(java.lang.String name)
public void setVersion(java.lang.String version)