Package org.apache.tools.ant.taskdefs
Class Manifest.Section
java.lang.Object
org.apache.tools.ant.taskdefs.Manifest.Section
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddAttributeAndCheck(Manifest.Attribute attribute) Add an attribute to the sectionvoidaddConfiguredAttribute(Manifest.Attribute attribute) Add an attribute to the section.clone()Clone this sectionbooleangetAttribute(String attributeName) Get a attribute of the sectionGet the attribute keys.getAttributeValue(String attributeName) Get the value of the attribute with the name given.getName()Get the Section's name.Get the warnings for this section.inthashCode()voidmerge(Manifest.Section section) Merge in another section without merging Class-Path attributes.voidmerge(Manifest.Section section, boolean mergeClassPaths) Merge in another sectionread(BufferedReader reader) Read a section through a reader.voidremoveAttribute(String attributeName) Remove the given attribute from the sectionvoidThe name of the section; optional -default is the main section.voidwrite(PrintWriter writer) Write the section out to a print writer without flattening multi-values attributes (i.e.voidwrite(PrintWriter writer, boolean flatten) Write the section out to a print writer.
- 
Constructor Details- 
Sectionpublic Section()
 
- 
- 
Method Details- 
setNameThe name of the section; optional -default is the main section.- Parameters:
- name- the section's name
 
- 
getName
- 
readRead 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
- IOException- if the section cannot be read from the reader.
 
- 
mergeMerge in another section without merging Class-Path attributes.- Parameters:
- section- the section to be merged with this one.
- Throws:
- ManifestException- if the sections cannot be merged.
 
- 
mergeMerge in another section- Parameters:
- section- the section to be merged with this one.
- mergeClassPaths- whether Class-Path attributes should be merged.
- Throws:
- ManifestException- if the sections cannot be merged.
 
- 
writeWrite the section out to a print writer without flattening multi-values attributes (i.e. Class-Path).- Parameters:
- writer- the Writer to which the section is written
- Throws:
- IOException- if the section cannot be written
 
- 
writeWrite the section out to a print writer.- Parameters:
- writer- the Writer to which the section is written
- flatten- whether to collapse multi-valued attributes (i.e. potentially Class-Path) Class-Path into a single attribute.
- Throws:
- IOException- if the section cannot be written
- Since:
- Ant 1.8.0
 
- 
getAttributeGet 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.
 
- 
getAttributeKeysGet the attribute keys.- Returns:
- an Enumeration of Strings, each string being the lower case key of an attribute of the section.
 
- 
getAttributeValue
- 
removeAttributeRemove the given attribute from the section- Parameters:
- attributeName- the name of the attribute to be removed.
 
- 
addConfiguredAttributeAdd an attribute to the section.- Parameters:
- attribute- the attribute to be added to the section
- Throws:
- ManifestException- if the attribute is not valid.
 
- 
addAttributeAndCheckAdd 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.
 
- 
clone
- 
getWarningsGet the warnings for this section.- Returns:
- an Enumeration of warning strings.
 
- 
hashCode
- 
equals
 
-