MimeHeaders (Java EE 5)

Java EE API


javax.xml.soap Class MimeHeaders

java.lang.Object
  extended by javax.xml.soap.MimeHeaders

public class MimeHeaders
extends Object


MimeHeader 对象的容器,这些对象表示出现在消息的 MIME 部分的 MIME 头。

此类主要在应用程序要根据某些 MIME 头和值来检索特定的附件时使用。该类最有可能由 AttachmentPart 的实现和 SAAJ API 的其他与 MIME 有关的部分使用。

英文文档:

A container for MimeHeader objects, which represent the MIME headers present in a MIME part of a message.

This class is used primarily when an application wants to retrieve specific attachments based on certain MIME headers and values. This class will most likely be used by implementations of AttachmentPart and other MIME dependent parts of the SAAJ API.

See Also:
SOAPMessage.getAttachments(), AttachmentPart

Constructor Summary
 
Method Summary
 void
 Iterator
 String[]
 Iterator
 Iterator
 void
 void
 void
 
Methods inherited from class java.lang.Object
 

Constructor Detail

public MimeHeaders()
构造一个用空 Vector 对象初始化的默认 MimeHeaders 对象。
英文文档:

MimeHeaders

public MimeHeaders()
Constructs a default MimeHeaders object initialized with an empty Vector object.

Method Detail

public String[] getHeader(String name)
String 对象数组的形式返回指定头的所有值。
name 将返回其值的头的名称
return 带有指定头的所有值的 String 数组
See also setHeader
英文文档:

getHeader

public String[] getHeader(String name)
Returns all of the values for the specified header as an array of String objects.

Parameters:
name - the name of the header for which values will be returned
Returns:
a String array with all of the values for the specified header
See Also:
setHeader(java.lang.String, java.lang.String)

public void setHeader(String name, String value)
将其名称与给定名称匹配的第一个头条目的当前值替换为给定值,如果现有的头名称都不匹配,则添加一个新的头。此方法还移第一个匹配头之后的所有匹配的头。

注意,RFC822 头只能包含 US-ASCII 字符。

name 一个 String,带有要搜索的头名称
value 一个 String,带有用来替换指定头的当前值的值
ThrowsIllegalArgumentException: 如果设置 MIME 头名称或值时存在问题
See also getHeader

英文文档:

setHeader

public void setHeader(String name,
                      String value)
Replaces the current value of the first header entry whose name matches the given name with the given value, adding a new header if no existing header name matches. This method also removes all matching headers after the first one.

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String with the name of the header for which to search
value - a String with the value that will replace the current value of the specified header
Throws:
IllegalArgumentException - if there was a problem in the mime header name or the value being set
See Also:
getHeader(java.lang.String)

public void addHeader(String name, String value)
将带有指定名称和值的 MimeHeader 对象添加到此 MimeHeaders 对象的头列表。

注意,RFC822 头只能包含 US-ASCII 字符。

name 一个 String,带有要添加的头的名称
value 一个 String,带有要添加的头的值
ThrowsIllegalArgumentException: 如果添加 MIME 头名称或值时存在问题

英文文档:

addHeader

public void addHeader(String name,
                      String value)
Adds a MimeHeader object with the specified name and value to this MimeHeaders object's list of headers.

Note that RFC822 headers can contain only US-ASCII characters.

Parameters:
name - a String with the name of the header to be added
value - a String with the value of the header to be added
Throws:
IllegalArgumentException - if there was a problem in the mime header name or value being added

public void removeHeader(String name)
移除其名称与给定名称匹配的所有 MimeHeader 对象。
name 一个 String,带有要搜索的头名称
英文文档:

removeHeader

public void removeHeader(String name)
Remove all MimeHeader objects whose name matches the given name.

Parameters:
name - a String with the name of the header for which to search

public void removeAllHeaders()
从此 MimeHeaders 对象中移除所有头条目。
英文文档:

removeAllHeaders

public void removeAllHeaders()
Removes all the header entries from this MimeHeaders object.


public java.util.Iterator<E> getAllHeaders()
返回此 MimeHeaders 对象中的所有 MimeHeader
return 一个 Iterator 对象,可在此 MimeHeaders 对象的 MimeHeader 对象列表上进行迭代
英文文档:

getAllHeaders

public Iterator getAllHeaders()
Returns all the MimeHeaders in this MimeHeaders object.

Returns:
an Iterator object over this MimeHeaders object's list of MimeHeader objects

public java.util.Iterator<E> getMatchingHeaders(String[] names)
返回其名称与给定名称数组中的任一名称匹配的所有 MimeHeader 对象。
names 带有要搜索的名称的 String 对象数组
return 一个 Iterator 对象,可在其名称与给定列表中的任一名称匹配的 MimeHeader 对象上进行迭代
英文文档:

getMatchingHeaders

public Iterator getMatchingHeaders(String[] names)
Returns all the MimeHeader objects whose name matches a name in the given array of names.

Parameters:
names - an array of String objects with the names for which to search
Returns:
an Iterator object over the MimeHeader objects whose name matches one of the names in the given list

public java.util.Iterator<E> getNonMatchingHeaders(String[] names)
返回其名称与给定名称数组中的任何名称都不匹配的所有 MimeHeader 对象。
names 带有要搜索的名称的 String 对象数组
return 一个 Iterator 对象,可在其名称与给定列表中的任何名称都不匹配的 MimeHeader 对象上进行迭代
英文文档:

getNonMatchingHeaders

public Iterator getNonMatchingHeaders(String[] names)
Returns all of the MimeHeader objects whose name does not match a name in the given array of names.

Parameters:
names - an array of String objects with the names for which to search
Returns:
an Iterator object over the MimeHeader objects whose name does not match one of the names in the given list


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!