public class Manifest extends Object implements Cloneable
Attributes
| Constructor and Description |
|---|
Manifest()
构造一个新的、空的清单。
|
Manifest(InputStream is)
从指定的输入流构造一个新的清单。
|
Manifest(Manifest man)
构造一个新的清单,该清单是指定的清单的副本。
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
清除主要属性以及在此清单中的条目。
|
Object |
clone()
返回此清单的一个浅副本。
|
boolean |
equals(Object o)
如果指定的对象也是一个清单,并具有相同的主属性和条目,则返回真。
|
Attributes |
getAttributes(String name)
返回指定的入口名称的属性。
|
Map<String,Attributes> |
getEntries()
返回包含在这个清单中的条目的Map。
|
Attributes |
getMainAttributes()
返回清单的主要属性。
|
int |
hashCode()
返回此清单的哈希代码。
|
void |
read(InputStream is)
从指定的输入流读取清单。
|
void |
write(OutputStream out)
写入到指定的输出流的体现。
|
public Manifest()
public Manifest(InputStream is) throws IOException
is含清单数据输入流
IOException如果发生I/O错误
public Manifest(Manifest man)
man -复制清单
public Attributes getMainAttributes()
public Map<String,Attributes> getEntries()
null关键,但有空键没有进入创造的
read(java.io.InputStream),也不是这样写的入门用
write(java.io.OutputStream)。
public Attributes getAttributes(String name)
返回(属性)getentries()。得到(名字)虽然
null是一个有效的
name,当
getAttributes(null)是从一个JAR文件获得
Manifest调用将返回,
null。而JAR文件本身不允许
null-named属性,可以调用
getEntries()在
Manifest,对那个结果,调用
put和空键和一个任意值。后续调用将返回的
getAttributes(null)刚刚
put价值。
请注意,此方法不返回清单的主要属性;看到getMainAttributes()。
name -条目名称
public void clear()
public void write(OutputStream out) throws IOException
out -输出流
IOException如果发生I/O错误
getMainAttributes()
public void read(InputStream is) throws IOException
is -输入流
IOException如果发生I/O错误
public boolean equals(Object o)
equals 方法重写,继承类
Object
o要比较的对象
Object.hashCode(),
HashMap
public int hashCode()
hashCode 方法重写,继承类
Object
Object.equals(java.lang.Object),
System.identityHashCode(java.lang.Object)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.