public static class Manifest.Attribute extends Manifest.BaseAttribute implements java.lang.Iterable<java.lang.String>
Modifier and Type | Field and Description |
---|---|
private int |
currentIndex
For multivalued attributes, this is the index of the attribute
currently being defined.
|
private java.util.Vector<java.lang.String> |
values
The attribute's value
|
name
Constructor and Description |
---|
Attribute()
Construct an empty attribute
|
Attribute(java.lang.String name,
java.lang.String value)
Construct a manifest by specifying its name and value
|
Modifier and Type | Method and Description |
---|---|
void |
addValue(java.lang.String value)
Add a new value to this attribute - making it multivalued.
|
boolean |
equals(java.lang.Object rhs) |
java.lang.String |
getKey()
Get the attribute's Key - its name in lower case.
|
private static java.lang.String |
getKey(java.lang.String name)
Get the key for the specified attribute name - its name in lower case.
|
java.lang.String |
getValue()
Get the Attribute's value.
|
int |
hashCode() |
java.util.Iterator<java.lang.String> |
iterator() |
void |
setName(java.lang.String name)
Set the Attribute's name; required
|
void |
setValue(java.lang.String value)
Set the Attribute's value; required
|
(package private) void |
write(java.io.Writer writer)
Writes the attribute out to a writer.
|
private void |
writeLine(java.io.Writer writer,
java.lang.String line)
Write a single Manifest line.
|
private void |
writeValue(java.io.Writer writer,
java.lang.String value)
Write a single attribute value out.
|
getName
private java.util.Vector<java.lang.String> values
private int currentIndex
public Attribute()
public Attribute(java.lang.String name, java.lang.String value)
name
- the attribute's namevalue
- the Attribute's valuepublic java.util.Iterator<java.lang.String> iterator()
iterator
in interface java.lang.Iterable<java.lang.String>
public int hashCode()
hashCode
in class Manifest.BaseAttribute
Object.hashCode()
public boolean equals(java.lang.Object rhs)
equals
in class Manifest.BaseAttribute
Object.equals(java.lang.Object)
public void setName(java.lang.String name)
name
- the attribute's namepublic java.lang.String getKey()
private static java.lang.String getKey(java.lang.String name)
public void setValue(java.lang.String value)
value
- the attribute's valuepublic java.lang.String getValue()
public void addValue(java.lang.String value)
value
- the attribute's additional valuevoid write(java.io.Writer writer) throws java.io.IOException
writer
- the Writer to which the attribute is writtenjava.io.IOException
- if the attribute value cannot be writtenprivate void writeValue(java.io.Writer writer, java.lang.String value) throws java.io.IOException
writer
- the Writer to which the attribute is writtenvalue
- the attribute valuejava.io.IOException
- if the attribute value cannot be writtenprivate void writeLine(java.io.Writer writer, java.lang.String line) throws java.io.IOException
writer
- the Writer to which the attribute is writtenline
- the manifest line to be writtenjava.io.IOException
- when Io excepts