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

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

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

Attributes.containsValue介绍

[英]Determines whether this Attributes contains the specified value.
[中]确定此属性是否包含指定的值。

代码示例

代码示例来源:origin: liimaorg/liima

private Manifest getBusinessManifest(String module){
  
  Manifest manifest = null;
  
  Enumeration<URL> resources = null;
  try {
    resources = getClass().getClassLoader().getResources("META-INF/MANIFEST.MF");
  }
  catch (IOException e) {
     log.log(Level.SEVERE, "Not able to load META-INF/MANIFEST.MF", e);
  }
  if(resources != null){
    while (resources.hasMoreElements()) {
      try {
       manifest = new Manifest(resources.nextElement().openStream());
       Attributes attributes = manifest.getMainAttributes();
       
       if(attributes != null && attributes.containsValue(module)){
         return manifest;
       }
      } catch (IOException e) {
        log.log(Level.SEVERE, "Not able to load META-INF/MANIFEST.MF", e);
      }
    }
  }
  return manifest;
}

代码示例来源:origin: org.projectodd.shrinkwrap.descriptors/shrinkwrap-descriptors-impl-base

public ManifestDescriptorImpl(String descriptorName, ManifestModel manifest) {
  this.descriptorName = descriptorName;
  this.manifest = manifest;
  // Export requires a manifest main version
  if (!manifest.getMainAttributes().containsValue(Name.MANIFEST_VERSION))
    manifest.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
}

代码示例来源:origin: org.jboss.shrinkwrap.descriptors/shrinkwrap-descriptors-impl-base

public ManifestDescriptorImpl(String descriptorName, ManifestModel manifest) {
  this.descriptorName = descriptorName;
  this.manifest = manifest;
  // Export requires a manifest main version
  if (!manifest.getMainAttributes().containsValue(Name.MANIFEST_VERSION))
    manifest.getMainAttributes().put(Name.MANIFEST_VERSION, "1.0");
}

相关文章