java.util.jar.Attributes.keySet()方法的使用及代码示例

x33g5p2x  于2022-01-15 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(116)

本文整理了Java中java.util.jar.Attributes.keySet()方法的一些代码示例,展示了Attributes.keySet()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Attributes.keySet()方法的具体详情如下:
包路径:java.util.jar.Attributes
类名称:Attributes
方法名:keySet

Attributes.keySet介绍

[英]Returns a Set containing all the keys found in this Attributes.
[中]返回包含在此属性中找到的所有键的集。

代码示例

代码示例来源:origin: geoserver/geoserver

final Iterator<Object> it = at.keySet().iterator();
while (it.hasNext()) {
  String attrName = ((Attributes.Name) it.next()).toString();

代码示例来源:origin: plutext/docx4j

for(Object key2  : mainAttribs.keySet() ) {
  mainAttribs = manifest.getAttributes((String)key);
  for(Object key2  : mainAttribs.keySet() ) {
    log.info(key2 + " : " + mainAttribs.getValue((java.util.jar.Attributes.Name)key2));

代码示例来源:origin: robovm/robovm

Iterator<?> entries = manifest.mainAttributes.keySet().iterator();
while (entries.hasNext()) {
  Attributes.Name name = (Attributes.Name) entries.next();
writeEntry(out, Attributes.Name.NAME, key, encoder, buffer);
Attributes attributes = manifest.entries.get(key);
Iterator<?> entries = attributes.keySet().iterator();
while (entries.hasNext()) {
  Attributes.Name name = (Attributes.Name) entries.next();

代码示例来源:origin: org.netbeans.api/org-openide-filesystems

protected Enumeration<String>  attributes(String name) {
  Attributes attr1 = getManifest().getAttributes(name);
  if (attr1 != null) {
    class ToString implements org.openide.util.Enumerations.Processor<Object, String> {
      public String process(Object obj, Collection<Object> ignore) {
        return obj.toString();
      }
    }
    return org.openide.util.Enumerations.convert(Collections.enumeration(attr1.keySet()), new ToString());
  } else {
    return org.openide.util.Enumerations.empty();
  }
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

private static Collection<String> getKeys( Attributes attributes )
{
  Collection<String> result = new ArrayList<String>();
  for ( Object objectObjectEntry : attributes.keySet() )
  {
    result.add( objectObjectEntry.toString() );
  }
  return result;
}

代码示例来源:origin: org.codehaus.plexus/plexus-archiver

/**
 * Merge in another section
 *
 * @param target The target manifest of the merge
 * @param section the section to be merged with this one.
 */
public static void mergeAttributes( java.util.jar.Attributes target, java.util.jar.Attributes section )
{
  for ( Object o : section.keySet() )
  {
    java.util.jar.Attributes.Name key = (Attributes.Name) o;
    final Object value = section.get( o );
    // the merge file always wins
    target.put( key, value );
  }
}

代码示例来源:origin: stackoverflow.com

for(Object attrkey: entry.getValue().keySet()) {
  if (attrkey instanceof Attributes.Name && 
    ((Attributes.Name)attrkey).toString().indexOf("-Digest") != -1)

代码示例来源:origin: opensourceBIM/BIMserver

Manifest manifest = new Manifest(url.openStream());
Attributes mainAttributes = manifest.getMainAttributes();
for (Object key : mainAttributes.keySet()) {
  if (key.toString().equals("Real-Main-Class")) {
    realMainClass = mainAttributes.get(key).toString();

代码示例来源:origin: eclipse/tycho

protected Set<Name> getNames(Attributes attributes) {
    Set<Name> result = new LinkedHashSet<>();
    for (Object key : attributes.keySet()) {
      Name name = (Name) key;
      if (!IGNORED_KEYS.contains(name)) {
        result.add(name);
      }
    }
    return result;
  }
}

代码示例来源:origin: org.jboss.gravia/gravia-resource

public static Dictionary<String, String> getManifestHeaders(Manifest manifest) {
    Hashtable<String, String> headers = new Hashtable<String, String>();
    Attributes mainatts = manifest.getMainAttributes();
    for (Object key : mainatts.keySet()) {
      String name = key.toString();
      String value = mainatts.getValue(name);
      headers.put(name, value);
    }
    return headers;
  }
}

代码示例来源:origin: org.jacoco/org.jacoco.core

private void filterManifestEntryAttributes(final Attributes attrs) {
  for (final Iterator<Object> i = attrs.keySet().iterator(); i.hasNext();) {
    if (String.valueOf(i.next()).endsWith(DIGEST_SUFFIX)) {
      i.remove();
    }
  }
}

代码示例来源:origin: org.jboss.shrinkwrap.resolver/shrinkwrap-resolver-impl-maven-archive

static Attributes mergeAttributes(Attributes source, Attributes target) {
    for (Object key : source.keySet()) {
      target.put(key, source.get(key));
    }
    return target;
  }
}

代码示例来源:origin: org.apache.aries.application/org.apache.aries.application.utils

private Map<String, String> getEntries(Attributes attrs) {
 Map<String, String> entries = new HashMap<String, String>();
 if ((attrs != null) && (!attrs.isEmpty())) {
  Set<Object> keys = attrs.keySet();
  for (Object key : keys) {
   entries.put(key.toString(),  attrs.getValue((Attributes.Name)key));
  }
 }
 return entries;
}

代码示例来源:origin: org.gridkit.3rd.btrace/core-api

private static boolean hasSignature(Attributes attrs) {
    for(Object k : attrs.keySet()) {
      if (((Attributes.Name)k).toString().endsWith("-Digest")) {
        return true;
      }
    }
    return false;
  }
}

代码示例来源:origin: shrinkwrap/resolver

static Attributes mergeAttributes(Attributes source, Attributes target) {
    for (Object key : source.keySet()) {
      target.put(key, source.get(key));
    }
    return target;
  }
}

代码示例来源:origin: biz.aQute/bnd

private void verifyHeaders(Attributes main) {
  for (Object element : main.keySet()) {
    Attributes.Name header = (Attributes.Name) element;
    String h = header.toString();
    if (!HEADER_PATTERN.matcher(h).matches())
      error("Invalid Manifest header: " + h + ", pattern="
          + HEADER_PATTERN);
  }
}

代码示例来源:origin: ch.unibas.cs.gravis/scalismo-native-stub

protected JogampVersion(final String packageName, final Manifest mf) {
  this.packageName = packageName;
  this.mf = ( null != mf ) ? mf : new Manifest();
  this.hash = this.mf.hashCode();
  mainAttributes = this.mf.getMainAttributes();
  mainAttributeNames = mainAttributes.keySet();
  androidPackageVersionName = AndroidUtils.getPackageInfoVersionName(packageName); // null if !Android
}

代码示例来源:origin: biz.aQute/aQute.bnd

private void verifyHeaders(Attributes main) {
  for (Object element : main.keySet()) {
    Attributes.Name header = (Attributes.Name) element;
    String h = header.toString();
    if (!HEADER_PATTERN.matcher(h).matches())
      error("Invalid Manifest header: " + h + ", pattern="
          + HEADER_PATTERN);
  }
}

代码示例来源:origin: org.glassfish.hk2/hk2-core

private void merge(Attributes target, Attributes source) {
  for (Object o : source.keySet()) {
    if (target.containsKey(o)) {
      String sep = mappings.containsKey(o.toString())?mappings.get(o.toString()):",";
      String newValue = target.get(o) + sep
          + source.get(o);
      target.put(o, newValue);
    } else {
      target.put(o, source.get(o));
    }
  }
}

代码示例来源:origin: org.glassfish.hk2/core

private void merge(Attributes target, Attributes source) {
  for (Object o : source.keySet()) {
    if (target.containsKey(o)) {
      String sep = mappings.containsKey(o.toString())?mappings.get(o.toString()):",";
      String newValue = target.get(o) + sep
          + source.get(o);
      target.put(o, newValue);
    } else {
      target.put(o, source.get(o));
    }
  }
}

相关文章