Javax.xml.soap.MimeHeaders Class



Introduction

The javax.xml.soap.MimeHeaders class returns the value of this MimeHeader object.Following are the important points about soap.MimeHeaders −

  • This class is used primarily when an application wants to retrieve specific attachments based on certain MIME headers and values.

  • This will most likely be used by implementations of AttachmentPart and other MIME dependent parts of the SAAJ API.

Class declaration

Following is the declaration for javax.xml.soap.MimeHeaders class −

public class MimeHeaders
   extends Object

Class constructors

S.N. Constructor & Description
1 MimeHeaders()

This constructs a default MimeHeaders object initialized with an empty Vector object.

Class methods

S.N. Method & Description
1 void addHeader(String name, String value)

This method adds a MimeHeader object with the specified name and value to this MimeHeaders object's list of headers.

2 Iterator getAllHeaders()

This method returns all the MimeHeaders in this MimeHeaders object.

3 String[] getHeader(String name)

This method returns all of the values for the specified header as an array of String objects.

4 Iterator getMatchingHeaders(String[] names)

This method returns all the MimeHeader objects whose name matches a name in the given array of names.

5 Iterator getNonMatchingHeaders(String[] names)

This method returns all of the MimeHeader objects whose name does not match a name in the given array of names.

6 void removeAllHeaders()

This method removes all the header entries from this MimeHeaders object.

7 void removeHeader(String name)

This method removes all MimeHeader objects whose name matches the given name.

8 void setHeader(String name, String value)

This method 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

This class inherits methods from the following classes −

java.lang.Object

Advertisements