Package org.codehaus.plexus.archiver.jar
Class Manifest.Section
java.lang.Object
org.codehaus.plexus.archiver.jar.Manifest.Section
- Enclosing class:
Manifest
A manifest section - you can nest attribute elements into sections.
A section consists of a set of attribute values,
separated from other sections by a blank line.
-
Field Summary
FieldsModifier and TypeFieldDescriptionIndex used to retain the attribute orderingprivate Hashtable
<String, Manifest.Attribute> The section's attributes.private String
The section's name if any.Warnings for this section -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddAttributeAndCheck
(Manifest.Attribute attribute) Add an attribute to the sectionvoid
addConfiguredAttribute
(Manifest.Attribute attribute) Add an attribute to the section.boolean
getAttribute
(String attributeName) Get a attribute of the sectiongetName()
Get the Section's name.Get the warnings for this section.int
hashCode()
iterator()
void
The name of the section; optional -default is the main section.protected void
storeAttribute
(Manifest.Attribute attribute) Store an attribute and update the index.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
warnings
Warnings for this section -
name
The section's name if any. The main section in a manifest is unnamed. -
attributes
The section's attributes. -
attributeIndex
Index used to retain the attribute ordering
-
-
Constructor Details
-
Section
public Section()
-
-
Method Details
-
setName
The name of the section; optional -default is the main section.- Parameters:
name
- the section's name
-
getName
Get the Section's name.- Returns:
- the section's name.
-
iterator
-
getAttribute
Get a attribute of the section- Parameters:
attributeName
- the name of the attribute- Returns:
- a Manifest.Attribute instance if the attribute is single-valued, otherwise a Vector of Manifest.Attribute instances.
-
addConfiguredAttribute
Add an attribute to the section.- Parameters:
attribute
- the attribute to be added to the section- Throws:
ManifestException
- if the attribute is not valid.
-
addAttributeAndCheck
Add an attribute to the section- Parameters:
attribute
- the attribute to be added.- Returns:
- the value of the attribute if it is a name attribute - null other wise
- Throws:
ManifestException
- if the attribute already exists in this section.
-
storeAttribute
Store an attribute and update the index.- Parameters:
attribute
- the attribute to be stored
-
getWarnings
Get the warnings for this section.- Returns:
- an Enumeration of warning strings.
-
hashCode
public int hashCode() -
equals
-