| |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.util.jar
类 Manifest
java.lang.Object java.util.jar.Manifest
- 所有已实现的接口:
- Cloneable
Manifest 类用于维护 Manifest 条目名称及其相关的 Attributes。既有主 Manifest 的 Attributes,也有每个条目的 Attributes。有关 Manifest 格式的信息,请参阅 Manifest 格式规范。
- 从以下版本开始:
- 1.2
- 另请参见:
Attributes
构造方法摘要 | |
---|---|
Manifest() 构造新的空 Manifest。 | |
Manifest(InputStream is) 从指定的输入流构造新的 Manifest。 | |
Manifest(Manifest man) 构造新的 Manifest,它是指定 Manifest 的副本。 |
方法摘要 | |
---|---|
void | clear() 清除此 Manifest 中的主 Attributes 和条目。 |
Object | clone() 返回 Manifest 的浅表复制。 |
boolean | equals(Object o) 如果指定的 Object 也是一个 Manifest,并且具有相同的主 Attributes 和条目,则返回 true。 |
Attributes | getAttributes(String name) 返回指定条目名称的 Attributes。 |
Map<String,Attributes> | getEntries() 返回此 Manifest 中所包含条目的 Map。 |
Attributes | getMainAttributes() 返回 Manifest 的主 Attributes。 |
int | hashCode() 返回 Manifest 的哈希码。 |
void | read(InputStream is) 从指定的 InputStream 读取 Manifest。 |
void | write(OutputStream out) 将 Manifest 写入指定的 OutputStream。 |
从类 java.lang.Object 继承的方法 |
---|
finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
Manifest
public Manifest()
- 构造新的空 Manifest。
Manifest
public Manifest(InputStream is) throws IOException
- 从指定的输入流构造新的 Manifest。
- 参数:
is
- 包含清单数据的输入流- 抛出:
IOException
- 如果发生 I/O 错误
Manifest
public Manifest(Manifest man)
- 构造新的 Manifest,它是指定 Manifest 的副本。
- 参数:
man
- 要复制的 Manifest
方法详细信息 |
---|
getMainAttributes
public Attributes getMainAttributes()
- 返回 Manifest 的主 Attributes。
- 返回:
- Manifest 的主 Attributes
getEntries
public Map<String,Attributes> getEntries()
- 返回此 Manifest 中所包含条目的 Map。每个条目由一个 String 名称(键)和相关的 Attributes(值)表示。
- 返回:
- 此 Manifest 中所包含条目的 Map
getAttributes
public Attributes getAttributes(String name)
- 返回指定条目名称的 Attributes。此方法定义为:
return (Attributes)getEntries().get(name)
- 参数:
name
- 条目名称。- 返回:
- 指定条目名称的 Attributes
clear
public void clear()
- 清除此 Manifest 中的主 Attributes 和条目。
write
public void write(OutputStream out) throws IOException
- 将 Manifest 写入指定的 OutputStream。在调用此方法前,必须在 MainAttributes 中设置 Attributes.Name.MANIFEST_VERSION。
- 参数:
out
- 输出流。- 抛出:
IOException
- 如果发生 I/O 错误。- 另请参见:
getMainAttributes()