org.codehaus.plexus.archiver.jar
Class Manifest.Section

java.lang.Object
  extended by org.codehaus.plexus.archiver.jar.Manifest.Section
All Implemented Interfaces:
Iterable<String>
Enclosing class:
Manifest

public static class Manifest.Section
extends Object
implements Iterable<String>

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.


Constructor Summary
Manifest.Section()
           
 
Method Summary
 String addAttributeAndCheck(Manifest.Attribute attribute)
          Add an attribute to the section
 void addConfiguredAttribute(Manifest.Attribute attribute)
          Add an attribute to the section.
 boolean equals(Object rhs)
           
 Manifest.Attribute getAttribute(String attributeName)
          Get a attribute of the section
 String getName()
          Get the Section's name.
 Enumeration<String> getWarnings()
          Get the warnings for this section.
 int hashCode()
           
 Iterator<String> iterator()
           
 void setName(String name)
          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
 

Constructor Detail

Manifest.Section

public Manifest.Section()
Method Detail

setName

public void setName(String name)
The name of the section; optional -default is the main section.

Parameters:
name - the section's name

getName

public String getName()
Get the Section's name.

Returns:
the section's name.

iterator

public Iterator<String> iterator()
Specified by:
iterator in interface Iterable<String>

getAttribute

public Manifest.Attribute getAttribute(String attributeName)
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

public void addConfiguredAttribute(Manifest.Attribute attribute)
                            throws ManifestException
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

public String addAttributeAndCheck(Manifest.Attribute attribute)
                            throws ManifestException
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

protected void storeAttribute(Manifest.Attribute attribute)
Store an attribute and update the index.

Parameters:
attribute - the attribute to be stored

getWarnings

public Enumeration<String> getWarnings()
Get the warnings for this section.

Returns:
an Enumeration of warning strings.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object rhs)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.