|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.soap Class MimeHeaders
java.lang.Object javax.xml.soap.MimeHeaders
public class MimeHeaders
- extends Object
MimeHeader
对象的容器,这些对象表示出现在消息的 MIME 部分的 MIME 头。
此类主要在应用程序要根据某些 MIME 头和值来检索特定的附件时使用。该类最有可能由 AttachmentPart
的实现和 SAAJ API 的其他与 MIME 有关的部分使用。
See also | getAttachments, javax.xml.soap.AttachmentPart |
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 | |
---|---|
MimeHeaders()
Constructs a default MimeHeaders object initialized with
an empty Vector object. |
Method Summary | |
---|---|
void |
addHeader(String name,
String value)
Adds a MimeHeader object with the specified name and value
to this MimeHeaders object's list of headers. |
Iterator |
getAllHeaders()
Returns all the MimeHeader s in this MimeHeaders object. |
String[] |
getHeader(String name)
Returns all of the values for the specified header as an array of String objects. |
Iterator |
getMatchingHeaders(String[] names)
Returns all the MimeHeader objects whose name matches
a name in the given array of names. |
Iterator |
getNonMatchingHeaders(String[] names)
Returns all of the MimeHeader objects whose name does not
match a name in the given array of names. |
void |
removeAllHeaders()
Removes all the header entries from this MimeHeaders object. |
void |
removeHeader(String name)
Remove all MimeHeader objects whose name matches the
given name. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
MimeHeaders()
构造一个用空 Vector
对象初始化的默认 MimeHeaders
对象。
英文文档:
MimeHeaders
public MimeHeaders()
- Constructs a default
MimeHeaders
object initialized with an emptyVector
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 ,带有用来替换指定头的当前值的值 |
Throws | IllegalArgumentException: 如果设置 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
- aString
with the name of the header for which to searchvalue
- aString
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 ,带有要添加的头的值 |
Throws | IllegalArgumentException: 如果添加 MIME 头名称或值时存在问题 |
addHeader
public void addHeader(String name, String value)
- Adds a
MimeHeader
object with the specified name and value to thisMimeHeaders
object's list of headers.Note that RFC822 headers can contain only US-ASCII characters.
- Parameters:
name
- aString
with the name of the header to be addedvalue
- aString
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
- aString
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
MimeHeader
s in thisMimeHeaders
object. - Returns:
- an
Iterator
object over thisMimeHeaders
object's list ofMimeHeader
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 ofString
objects with the names for which to search- Returns:
- an
Iterator
object over theMimeHeader
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 ofString
objects with the names for which to search- Returns:
- an
Iterator
object over theMimeHeader
objects whose name does not match one of the names in the given list
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!