public static class Manifest.Section
extends java.lang.Object
Constructor and Description |
---|
Section() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
addAttributeAndCheck(Manifest.Attribute attribute)
Add an attribute to the section
|
void |
addConfiguredAttribute(Manifest.Attribute attribute)
Add an attribute to the section.
|
java.lang.Object |
clone()
Clone this section
|
boolean |
equals(java.lang.Object rhs) |
Manifest.Attribute |
getAttribute(java.lang.String attributeName)
Get a attribute of the section
|
java.util.Enumeration<java.lang.String> |
getAttributeKeys()
Get the attribute keys.
|
java.lang.String |
getAttributeValue(java.lang.String attributeName)
Get the value of the attribute with the name given.
|
java.lang.String |
getName()
Get the Section's name.
|
java.util.Enumeration<java.lang.String> |
getWarnings()
Get the warnings for this section.
|
int |
hashCode() |
void |
merge(Manifest.Section section)
Merge in another section without merging Class-Path attributes.
|
void |
merge(Manifest.Section section,
boolean mergeClassPaths)
Merge in another section
|
java.lang.String |
read(java.io.BufferedReader reader)
Read a section through a reader.
|
void |
removeAttribute(java.lang.String attributeName)
Remove the given attribute from the section
|
void |
setName(java.lang.String name)
The name of the section; optional -default is the main section.
|
void |
write(java.io.PrintWriter writer)
Write the section out to a print writer without flattening
multi-values attributes (i.e.
|
void |
write(java.io.PrintWriter writer,
boolean flatten)
Write the section out to a print writer.
|
public void setName(java.lang.String name)
name
- the section's namepublic java.lang.String getName()
public java.lang.String read(java.io.BufferedReader reader) throws ManifestException, java.io.IOException
reader
- the reader from which the section is readManifestException
- if the section is not valid according
to the JAR specjava.io.IOException
- if the section cannot be read from the reader.public void merge(Manifest.Section section) throws ManifestException
section
- the section to be merged with this one.ManifestException
- if the sections cannot be merged.public void merge(Manifest.Section section, boolean mergeClassPaths) throws ManifestException
section
- the section to be merged with this one.mergeClassPaths
- whether Class-Path attributes should
be merged.ManifestException
- if the sections cannot be merged.public void write(java.io.PrintWriter writer) throws java.io.IOException
writer
- the Writer to which the section is writtenjava.io.IOException
- if the section cannot be writtenpublic void write(java.io.PrintWriter writer, boolean flatten) throws java.io.IOException
writer
- the Writer to which the section is writtenflatten
- whether to collapse multi-valued attributes
(i.e. potentially Class-Path) Class-Path into a
single attribute.java.io.IOException
- if the section cannot be writtenpublic Manifest.Attribute getAttribute(java.lang.String attributeName)
attributeName
- the name of the attributepublic java.util.Enumeration<java.lang.String> getAttributeKeys()
public java.lang.String getAttributeValue(java.lang.String attributeName)
attributeName
- the name of the attribute to be returned.public void removeAttribute(java.lang.String attributeName)
attributeName
- the name of the attribute to be removed.public void addConfiguredAttribute(Manifest.Attribute attribute) throws ManifestException
attribute
- the attribute to be added to the sectionManifestException
- if the attribute is not valid.public java.lang.String addAttributeAndCheck(Manifest.Attribute attribute) throws ManifestException
attribute
- the attribute to be added.ManifestException
- if the attribute already
exists in this section.public java.lang.Object clone()
clone
in class java.lang.Object
public java.util.Enumeration<java.lang.String> getWarnings()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object rhs)
equals
in class java.lang.Object
rhs
- the object to check for equality.Object.equals(java.lang.Object)