Best code examples for Java 8 Attributes class (java.util.jar.Attributes)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 Attributes class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 Attributes examples from Open Source projects
This code example shows how to use the following methods: getValue
     * does not bundle any extensions 
     */ 
    private ArrayList getAvailableExtensions(Manifest manifest) {
 
        Attributes attributes = manifest.getMainAttributes();
        String name = attributes.getValue("Extension-Name");
        if (name == null)
            return null; 
 
        ArrayList extensionList = new ArrayList();
 
        Extension extension = new Extension();
        extension.setExtensionName(name);
        extension.setImplementationURL(
            attributes.getValue("Implementation-URL"));
        extension.setImplementationVendor(
            attributes.getValue("Implementation-Vendor"));
        extension.setImplementationVendorId(
            attributes.getValue("Implementation-Vendor-Id"));
        extension.setImplementationVersion(

7
CodeRank
This code example shows how to use the following methods: put, putAll
import java.util.jar.Attributes; 
import java.util.HashMap; 
 
public class PutAndPutAll { 
    public static void main(String[] args) throws Exception {
        Attributes at = new Attributes();
        try{ 
            at.put("this is not an Attributes.Name", "value");
            throw new Exception("put should check for non Attributes.Name names");
        } catch (ClassCastException e) {
        } 
 
        try{ 
            at.put(new Attributes.Name("name"), new Integer(0));
            throw new Exception("put should check for non String values");
        } catch (ClassCastException e) {
        } 
 
        try { 
            at.putAll(new HashMap());

7
CodeRank
This code example shows how to use the following methods: getValue
     * does not bundle any extensions 
     */ 
    private ArrayList<Extension> getAvailableExtensions(Manifest manifest) {
 
        Attributes attributes = manifest.getMainAttributes();
        String name = attributes.getValue("Extension-Name");
        if (name == null)
            return null; 
 
        ArrayList<Extension> extensionList = new ArrayList<Extension>();
 
        Extension extension = new Extension();
        extension.setExtensionName(name);
        extension.setImplementationURL(
            attributes.getValue("Implementation-URL"));
        extension.setImplementationVendor(
            attributes.getValue("Implementation-Vendor"));
        extension.setImplementationVendorId(
            attributes.getValue("Implementation-Vendor-Id"));
        extension.setImplementationVersion(

7
CodeRank
This code example shows how to use the following methods: getValue
This code example shows how to use the following methods: put
    } 
 
    @Override 
    void includeAttribute(Name attribute, String value) {
        Map<String, Attributes> entries = manifest.getEntries();
        Attributes attributes = entries.containsKey(entryName) ? manifest.getAttributes(entryName) : new Attributes();
        attributes.put(attribute, value);
        entries.put(entryName, attributes);
    } 
 
    @Override 
    String findAttribute(Name name) {
        Map<String, Attributes> entries = manifest.getEntries();
        if (entries.containsKey(entryName))
            return manifest.getAttributes(entryName).getValue(name);
 
        return null; 
    } 
 
    @Override 
Full Snippet Info
6
CodeRank
See Code Examples for Java 8 Attributes Methods: