org.apache.tools.ant.taskdefs
Class Manifest.Section
java.lang.Object
org.apache.tools.ant.taskdefs.Manifest.Section
- Manifest
public static class Manifest.Section
extends java.lang.Object
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.
addAttributeAndCheck
public String addAttributeAndCheck(Manifest.Attribute attribute)
throws ManifestException
Add an attribute to the section
attribute
- the attribute to be added.
- the value of the attribute if it is a name
attribute - null other wise
addConfiguredAttribute
public void addConfiguredAttribute(Manifest.Attribute attribute)
throws ManifestException
Add an attribute to the section.
attribute
- the attribute to be added to the section
clone
public Object clone()
Clone this section
equals
public boolean equals(Object rhs)
getAttribute
public Manifest.Attribute getAttribute(String attributeName)
Get a attribute of the section
attributeName
- the name of the attribute
- a Manifest.Attribute instance if the attribute is
single-valued, otherwise a Vector of Manifest.Attribute
instances.
getAttributeKeys
public Enumeration getAttributeKeys()
Get the attribute keys.
- an Enumeration of Strings, each string being the lower case
key of an attribute of the section.
getAttributeValue
public String getAttributeValue(String attributeName)
Get the value of the attribute with the name given.
attributeName
- the name of the attribute to be returned.
- the attribute's value or null if the attribute does not exist
in the section
getName
public String getName()
Get the Section's name.
getWarnings
public Enumeration getWarnings()
Get the warnings for this section.
- an Enumeration of warning strings.
hashCode
public int hashCode()
java.lang.Object.hashCode
read
public String read(BufferedReader reader)
throws ManifestException,
IOException
Read a section through a reader.
reader
- the reader from which the section is read
- the name of the next section if it has been read as
part of this section - This only happens if the
Manifest is malformed.
removeAttribute
public void removeAttribute(String attributeName)
Remove tge given attribute from the section
attributeName
- the name of the attribute to be removed.
setName
public void setName(String name)
The name of the section; optional -default is the main section.
name
- the section's name
write
public void write(PrintWriter writer)
throws IOException
Write the section out to a print writer.
writer
- the Writer to which the section is written
Copyright B) 2000-2008 Apache Software Foundation. All Rights Reserved.