org.apache.tools.ant.taskdefs
Class Manifest.Section

java.lang.Object
  |
  +--org.apache.tools.ant.taskdefs.Manifest.Section
Enclosing class:
Manifest

public static class Manifest.Section
extends java.lang.Object

Class to represent an individual section in the Manifest. A section consists of a set of attribute values, separated from other sections by a blank line.


Constructor Summary
Manifest.Section()
           
 
Method Summary
 java.lang.String addAttributeAndCheck(Manifest.Attribute attribute)
          Add an attribute to the section
 void addConfiguredAttribute(Manifest.Attribute attribute)
           
 boolean equals(java.lang.Object rhs)
           
 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 getWarnings()
           
 void merge(Manifest.Section section)
          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 tge given attribute from the section
 void setName(java.lang.String name)
          Set the Section's name
 void write(java.io.PrintWriter writer)
          Write the section out to a print writer.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manifest.Section

public Manifest.Section()
Method Detail

setName

public void setName(java.lang.String name)
Set the Section's name
Parameters:
name - the section's name

getName

public java.lang.String getName()
Get the Section's name
Returns:
the section's name.

read

public java.lang.String read(java.io.BufferedReader reader)
                      throws ManifestException,
                             java.io.IOException
Read a section through a reader
Parameters:
reader - the reader from which the section is read
Returns:
the name of the next section if it has been read as part of this section - This only happens if the Manifest is malformed.
Throws:
ManifestException - if the section is not valid according to the JAR spec
java.io.IOException - if the section cannot be read from the reader.

merge

public void merge(Manifest.Section section)
           throws ManifestException
Merge in another section
Parameters:
section - the section to be merged with this one.
Throws:
ManifestException - if the sections cannot be merged.

write

public void write(java.io.PrintWriter writer)
           throws java.io.IOException
Write the section out to a print writer.
Parameters:
writer - the Writer to which the section is written
Throws:
java.io.IOException - if the section cannot be written

getAttributeValue

public java.lang.String getAttributeValue(java.lang.String attributeName)
Get the value of the attribute with the name given.
Parameters:
attributeName - the name of the attribute to be returned.
Returns:
the attribute's value or null if the attribute does not exist in the section

removeAttribute

public void removeAttribute(java.lang.String attributeName)
Remove tge given attribute from the section
Parameters:
attributeName - the name of the attribute to be removed.

addConfiguredAttribute

public void addConfiguredAttribute(Manifest.Attribute attribute)
                            throws ManifestException

addAttributeAndCheck

public java.lang.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.

getWarnings

public java.util.Enumeration getWarnings()

equals

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


Copyright © 1999-2002 Apache Software Foundation. All Rights Reserved.