Package org.codehaus.plexus.archiver.jar
Class Manifest.Attribute
- java.lang.Object
-
- org.codehaus.plexus.archiver.jar.Manifest.BaseAttribute
-
- org.codehaus.plexus.archiver.jar.Manifest.Attribute
-
- All Implemented Interfaces:
java.lang.Iterable<java.lang.String>
- Direct Known Subclasses:
Manifest.ExistingAttribute
- Enclosing class:
- Manifest
public static class Manifest.Attribute extends Manifest.BaseAttribute implements java.lang.Iterable<java.lang.String>
An attribute for the manifest. Those attributes that are not nested into a section will be added to the "Main" section.
-
-
Field Summary
Fields Modifier and Type Field Description private intcurrentIndexFor multivalued attributes, this is the index of the attribute currently being defined.private java.util.Vector<java.lang.String>valuesThe attribute's value-
Fields inherited from class org.codehaus.plexus.archiver.jar.Manifest.BaseAttribute
name
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(java.lang.String value)Add a new value to this attribute - making it multivalued.booleanequals(java.lang.Object rhs)java.lang.StringgetKey()Get the attribute's Key - its name in lower case.private static java.lang.StringgetKey(java.lang.String name)Get the key for the specified attribute name - its name in lower case.java.lang.StringgetValue()Get the Attribute's value.inthashCode()java.util.Iterator<java.lang.String>iterator()voidsetName(java.lang.String name)Set the Attribute's name; requiredvoidsetValue(java.lang.String value)Set the Attribute's value; required(package private) voidwrite(java.io.Writer writer)Writes the attribute out to a writer.private voidwriteLine(java.io.Writer writer, java.lang.String line)Write a single Manifest line.private voidwriteValue(java.io.Writer writer, java.lang.String value)Write a single attribute value out.-
Methods inherited from class org.codehaus.plexus.archiver.jar.Manifest.BaseAttribute
getName
-
-
-
-
Method Detail
-
iterator
public java.util.Iterator<java.lang.String> iterator()
- Specified by:
iteratorin interfacejava.lang.Iterable<java.lang.String>
-
hashCode
public int hashCode()
- Overrides:
hashCodein classManifest.BaseAttribute- See Also:
Object.hashCode()
-
equals
public boolean equals(java.lang.Object rhs)
- Overrides:
equalsin classManifest.BaseAttribute- See Also:
Object.equals(java.lang.Object)
-
setName
public void setName(java.lang.String name)
Set the Attribute's name; required- Parameters:
name- the attribute's name
-
getKey
public java.lang.String getKey()
Get the attribute's Key - its name in lower case.- Returns:
- the attribute's key.
-
getKey
private static java.lang.String getKey(java.lang.String name)
Get the key for the specified attribute name - its name in lower case.- Returns:
- the attribute's key.
-
setValue
public void setValue(java.lang.String value)
Set the Attribute's value; required- Parameters:
value- the attribute's value
-
getValue
public java.lang.String getValue()
Get the Attribute's value.- Returns:
- the attribute's value.
-
addValue
public void addValue(java.lang.String value)
Add a new value to this attribute - making it multivalued.- Parameters:
value- the attribute's additional value
-
write
void write(java.io.Writer writer) throws java.io.IOExceptionWrites the attribute out to a writer.- Parameters:
writer- the Writer to which the attribute is written- Throws:
java.io.IOException- if the attribute value cannot be written
-
writeValue
private void writeValue(java.io.Writer writer, java.lang.String value) throws java.io.IOExceptionWrite a single attribute value out. Should handle multiple lines of attribute value.- Parameters:
writer- the Writer to which the attribute is writtenvalue- the attribute value- Throws:
java.io.IOException- if the attribute value cannot be written
-
writeLine
private void writeLine(java.io.Writer writer, java.lang.String line) throws java.io.IOExceptionWrite a single Manifest line. Should handle more than 72 bytes of line- Parameters:
writer- the Writer to which the attribute is writtenline- the manifest line to be written- Throws:
java.io.IOException- when Io excepts
-
-