public class MergeableManifest2
extends java.lang.Object
implements java.lang.Cloneable
MergeableManifest but without reflection.
Reflection causes warnings that it might get be removed in future versions.
Hence we implement the functionality with all the inherited one by ourself.| Modifier and Type | Class and Description |
|---|---|
class |
MergeableManifest2.Attributes
A map that updates the "modified" state of the owning
MergeableManifest2. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
BUNDLE_ACTIVATOR |
static java.lang.String |
BUNDLE_REQUIREDEXECUTIONENVIRONMENT |
static java.lang.String |
BUNDLE_SYMBOLIC_NAME |
static java.lang.String |
EXPORT_PACKAGE |
static java.lang.String |
IMPORT_PACKAGE |
static java.lang.String |
MANIFEST_VERSION |
static java.lang.String |
REQUIRE_BUNDLE |
static java.lang.String |
SIGNATURE_VERSION |
| Constructor and Description |
|---|
MergeableManifest2(java.io.InputStream stream)
Create a new manifest from the given stream.
|
MergeableManifest2(java.io.InputStream stream,
java.lang.String name)
Create a new manifest from the given stream and with the given name.
|
MergeableManifest2(MergeableManifest2 toCopy)
Create a copy from the given one.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addExportedPackages(java.util.Set<java.lang.String> exportedPackages)
Add the set with given bundles to the "Export-Package" main attribute.
|
void |
addExportedPackages(java.lang.String... exportedPackages)
Add the list with given bundles to the "Export-Package" main attribute.
|
void |
addImportedPackages(java.util.Set<java.lang.String> importedPackages)
Add the set with given bundles to the "Import-Package" main attribute.
|
void |
addImportedPackages(java.lang.String... importedPackages)
Add the list with given bundles to the "Import-Package" main attribute.
|
void |
addRequiredBundles(java.util.Set<java.lang.String> requiredBundles)
Add the set with given bundles to the "Require-Bundle" main attribute.
|
void |
addRequiredBundles(java.lang.String... requiredBundles)
Add the list with given bundles to the "Require-Bundle" main attribute.
|
void |
clear()
Remove all main entries and all section entries.
|
MergeableManifest2 |
clone() |
boolean |
equals(java.lang.Object obj) |
MergeableManifest2.Attributes |
getAttributes(java.lang.String name) |
java.lang.String |
getBREE() |
java.lang.String |
getBundleActivator() |
java.util.Map<java.lang.String,MergeableManifest2.Attributes> |
getEntries() |
MergeableManifest2.Attributes |
getMainAttributes() |
int |
hashCode() |
boolean |
isModified() |
static java.lang.String |
make512Safe(java.lang.StringBuffer input,
java.lang.String newline)
Return a string that ensures that no line is longer then 512 characters
and lines are broken according to manifest specification.
|
void |
setBREE(java.lang.String bree)
Set the main attribute "Bundle-RequiredExecutionEnvironment" to the given
value.
|
void |
setBundleActivator(java.lang.String bundleActivator)
Set the main attribute "Bundle-Activator" to the given value.
|
void |
setLineDelimiter(java.lang.String lineDelimeter)
Set the line delimiter to a specific value.
|
void |
write(java.io.OutputStream stream)
Write the contents to the manifest to the given stream.
|
public static final java.lang.String MANIFEST_VERSION
public static final java.lang.String SIGNATURE_VERSION
public static final java.lang.String REQUIRE_BUNDLE
public static final java.lang.String BUNDLE_SYMBOLIC_NAME
public static final java.lang.String EXPORT_PACKAGE
public static final java.lang.String IMPORT_PACKAGE
public static final java.lang.String BUNDLE_REQUIREDEXECUTIONENVIRONMENT
public static final java.lang.String BUNDLE_ACTIVATOR
public MergeableManifest2(java.io.InputStream stream,
java.lang.String name)
throws java.io.IOException
stream - The stream to read the manifest content from.name - The name of the manifest, written to "Bundle-SymbolicName".java.io.IOExceptionpublic MergeableManifest2(java.io.InputStream stream)
throws java.io.IOException
stream - The stream to read the manifest content from.java.io.IOExceptionpublic MergeableManifest2(MergeableManifest2 toCopy)
toCopy - The original manifest to copy.public MergeableManifest2.Attributes getMainAttributes()
public MergeableManifest2.Attributes getAttributes(java.lang.String name)
public java.util.Map<java.lang.String,MergeableManifest2.Attributes> getEntries()
public boolean isModified()
public void clear()
public void addRequiredBundles(java.util.Set<java.lang.String> requiredBundles)
requiredBundles - The set with all bundles to add.public void addRequiredBundles(java.lang.String... requiredBundles)
requiredBundles - The list of all bundles to add.public void addImportedPackages(java.util.Set<java.lang.String> importedPackages)
importedPackages - The set of all packages to add.public void addImportedPackages(java.lang.String... importedPackages)
importedPackages - The list of all packages to add.public void addExportedPackages(java.util.Set<java.lang.String> exportedPackages)
exportedPackages - The set of all packages to add.public void addExportedPackages(java.lang.String... exportedPackages)
exportedPackages - The list of all packages to add.public void setBREE(java.lang.String bree)
bree - The new valuepublic java.lang.String getBREE()
public void setBundleActivator(java.lang.String bundleActivator)
bundleActivator - The new valuepublic java.lang.String getBundleActivator()
public void setLineDelimiter(java.lang.String lineDelimeter)
lineDelimeter - typically either "\n" or "\r\n".public void write(java.io.OutputStream stream)
throws java.io.IOException
stream - the stream to write the output to.java.io.IOExceptionpublic MergeableManifest2 clone() throws java.lang.CloneNotSupportedException
clone in class java.lang.Objectjava.lang.CloneNotSupportedExceptionpublic static java.lang.String make512Safe(java.lang.StringBuffer input,
java.lang.String newline)
input - The buffer containing the content that should be made safenewline - The string to use to create newlines (usually "\n" or
"\r\n")MergeableManifest2.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Object