Class MutableBundleManifest
- java.lang.Object
-
- org.eclipse.tycho.versions.bundle.MutableBundleManifest
-
public class MutableBundleManifest extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<ManifestAttribute>attributesprivate java.lang.StringlineEndingprivate java.lang.Stringunparsed
-
Constructor Summary
Constructors Constructor Description MutableBundleManifest()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(ManifestAttribute attribute)private ManifestAttributegetAttribute(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.StringgetFragmentHostSymbolicName()java.lang.StringgetFragmentHostVersion()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 versionsjava.lang.StringgetSymbolicName()java.lang.StringgetVersion()booleanisFragment()private org.eclipse.osgi.util.ManifestElement[]parseHeader(java.lang.String name)private java.util.List<MutableManifestElement>parseHeaderForMutation(java.lang.String name)static MutableBundleManifestread(java.io.File file)static MutableBundleManifestread(java.io.InputStream is)private static java.lang.StringreadLineWithLineEnding(java.io.PushbackReader reader, MutableBundleManifest mf)voidsetFragmentHostVersion(java.lang.String newVersion)private voidsetLineEndingWhenFirstLine(java.lang.String lineEnding)private voidsetUnparsed(java.lang.String unparsed)voidsetVersion(java.lang.String version)voidupdateExportedPackageVersions(java.util.Map<java.lang.String,java.lang.String> versionsToUpdate)Updates version for packages in Export-Package with the version provided in the map.voidupdateImportedPackageVersions(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.voidupdateRequiredBundleVersions(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 voidwrite(MutableBundleManifest mf, java.io.File file)static voidwrite(MutableBundleManifest mf, java.io.OutputStream os)
-
-
-
Field Detail
-
attributes
private final java.util.List<ManifestAttribute> attributes
-
lineEnding
private java.lang.String lineEnding
-
unparsed
private java.lang.String unparsed
-
-
Method Detail
-
add
public void add(ManifestAttribute attribute)
-
read
public static MutableBundleManifest read(java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
read
public static MutableBundleManifest read(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
readLineWithLineEnding
private static java.lang.String readLineWithLineEnding(java.io.PushbackReader reader, MutableBundleManifest mf) throws java.io.IOException- Throws:
java.io.IOException
-
setLineEndingWhenFirstLine
private void setLineEndingWhenFirstLine(java.lang.String lineEnding)
-
setUnparsed
private void setUnparsed(java.lang.String unparsed)
-
write
public static void write(MutableBundleManifest mf, java.io.File file) throws java.io.IOException
- Throws:
java.io.IOException
-
write
public static void write(MutableBundleManifest mf, java.io.OutputStream os) throws java.io.IOException
- Throws:
java.io.IOException
-
getSymbolicName
public java.lang.String getSymbolicName()
-
getVersion
public java.lang.String getVersion()
-
getFragmentHostSymbolicName
public java.lang.String getFragmentHostSymbolicName()
-
isFragment
public boolean isFragment()
-
getFragmentHostVersion
public java.lang.String getFragmentHostVersion()
-
setFragmentHostVersion
public void setFragmentHostVersion(java.lang.String newVersion)
-
getRequiredBundleVersions
public java.util.Map<java.lang.String,java.lang.String> getRequiredBundleVersions()
Read the RequiredBundle with optional versions- Returns:
-
updateRequiredBundleVersions
public 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.- Parameters:
versionsToUpdate- the bundle/version-range map. Keys are the bundle symbolicnames to update and the values are the new version range to apply.
-
getImportPackagesVersions
public 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.The map keys are the package names and the values are the version range if present or null when absent.
- Returns:
-
updateImportedPackageVersions
public 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.- Parameters:
versionsToUpdate- the package/version-range map. Keys are the package names to update and the values are the new version range to apply.
-
getExportedPackagesVersion
public 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.- Returns:
- the package/version map. Keys are the package names and the values are the version if present or null when absent.
-
updateExportedPackageVersions
public 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.- Parameters:
versionsToUpdate- the package/version map. Keys are the package names to update and the values are the newVersion to apply.
-
parseHeader
private org.eclipse.osgi.util.ManifestElement[] parseHeader(java.lang.String name)
-
parseHeaderForMutation
private java.util.List<MutableManifestElement> parseHeaderForMutation(java.lang.String name)
-
getAttribute
private ManifestAttribute getAttribute(java.lang.String name)
-
setVersion
public void setVersion(java.lang.String version)
-
-