org.codehaus.plexus.archiver.jar
Class Manifest.Attribute

java.lang.Object
  extended by org.codehaus.plexus.archiver.jar.Manifest.BaseAttribute
      extended by org.codehaus.plexus.archiver.jar.Manifest.Attribute
All Implemented Interfaces:
Iterable<String>
Direct Known Subclasses:
Manifest.ExistingAttribute
Enclosing class:
Manifest

public static class Manifest.Attribute
extends Manifest.BaseAttribute
implements Iterable<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 inherited from class org.codehaus.plexus.archiver.jar.Manifest.BaseAttribute
name
 
Constructor Summary
Manifest.Attribute()
          Construct an empty attribute
Manifest.Attribute(String name, String value)
          Construct a manifest by specifying its name and value
 
Method Summary
 void addValue(String value)
          Add a new value to this attribute - making it multivalued.
 boolean equals(Object rhs)
           
 String getKey()
          Get the attribute's Key - its name in lower case.
 String getValue()
          Get the Attribute's value.
 int hashCode()
           
 Iterator<String> iterator()
           
 void setName(String name)
          Set the Attribute's name; required
 void setValue(String value)
          Set the Attribute's value; required
 
Methods inherited from class org.codehaus.plexus.archiver.jar.Manifest.BaseAttribute
getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Manifest.Attribute

public Manifest.Attribute()
Construct an empty attribute


Manifest.Attribute

public Manifest.Attribute(String name,
                          String value)
Construct a manifest by specifying its name and value

Parameters:
name - the attribute's name
value - the Attribute's value
Method Detail

iterator

public Iterator<String> iterator()
Specified by:
iterator in interface Iterable<String>

hashCode

public int hashCode()
Overrides:
hashCode in class Manifest.BaseAttribute
See Also:
Object.hashCode()

equals

public boolean equals(Object rhs)
Overrides:
equals in class Manifest.BaseAttribute
See Also:
Object.equals(java.lang.Object)

setName

public void setName(String name)
Set the Attribute's name; required

Parameters:
name - the attribute's name

getKey

public String getKey()
Get the attribute's Key - its name in lower case.

Returns:
the attribute's key.

setValue

public void setValue(String value)
Set the Attribute's value; required

Parameters:
value - the attribute's value

getValue

public String getValue()
Get the Attribute's value.

Returns:
the attribute's value.

addValue

public void addValue(String value)
Add a new value to this attribute - making it multivalued.

Parameters:
value - the attribute's additional value


Copyright © 2008-2012 Sonatype, Inc.. All Rights Reserved.