public static class Manifest.Attribute
extends java.lang.Object
Constructor and Description |
---|
Attribute()
Construct an empty attribute
|
Attribute(java.lang.String line)
Construct an attribute by parsing a line from the Manifest
|
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 |
addContinuation(java.lang.String line)
Add a continuation line from the Manifest file.
|
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.
|
java.lang.String |
getName()
Get the Attribute's name
|
java.lang.String |
getValue()
Get the Attribute's value.
|
java.util.Enumeration<java.lang.String> |
getValues()
Get all the attribute's values.
|
int |
hashCode() |
void |
parse(java.lang.String line)
Parse a line into name and value pairs
|
void |
setName(java.lang.String name)
Set the Attribute's name; required
|
void |
setValue(java.lang.String value)
Set the Attribute's value; required
|
void |
write(java.io.PrintWriter writer)
Write the attribute out to a print writer without
flattening multi-values attributes (i.e.
|
void |
write(java.io.PrintWriter writer,
boolean flatten)
Write the attribute out to a print writer.
|
public Attribute()
public Attribute(java.lang.String line) throws ManifestException
line
- the line containing the attribute name and valueManifestException
- if the line is not validpublic Attribute(java.lang.String name, java.lang.String value)
name
- the attribute's namevalue
- the Attribute's valuepublic int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public boolean equals(java.lang.Object rhs)
equals
in class java.lang.Object
rhs
- the object to check for equality.Object.equals(java.lang.Object)
public void parse(java.lang.String line) throws ManifestException
line
- the line to be parsedManifestException
- if the line does not contain a colon
separating the name and valuepublic void setName(java.lang.String name)
name
- the attribute's namepublic java.lang.String getName()
public java.lang.String getKey()
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 valuepublic java.util.Enumeration<java.lang.String> getValues()
public void addContinuation(java.lang.String line)
line
- the continuation line.public void write(java.io.PrintWriter writer) throws java.io.IOException
writer
- the Writer to which the attribute is writtenjava.io.IOException
- if the attribute value cannot be writtenpublic void write(java.io.PrintWriter writer, boolean flatten) throws java.io.IOException
writer
- the Writer to which the attribute is writtenflatten
- whether to collapse multi-valued attributes
(i.e. potentially Class-Path) Class-Path into a
single attribute.java.io.IOException
- if the attribute value cannot be written