KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > saaj > MimeHeaders


1 /*
2  * Copyright 2004,2005 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16 package org.apache.axis2.saaj;
17
18 import javax.xml.soap.MimeHeader JavaDoc;
19 import java.util.Iterator JavaDoc;
20
21 /**
22  * @author Ashutosh Shahi ashutosh.shahi@gmail.com
23  *
24  * TODO To change the template for this generated type comment go to
25  * Window - Preferences - Java - Code Style - Code Templates
26  */

27 public class MimeHeaders extends javax.xml.soap.MimeHeaders JavaDoc {
28     public MimeHeaders() {
29     }
30
31     public MimeHeaders(javax.xml.soap.MimeHeaders JavaDoc h) {
32         Iterator JavaDoc iterator = h.getAllHeaders();
33         while (iterator.hasNext()) {
34             MimeHeader JavaDoc hdr = (MimeHeader JavaDoc) iterator.next();
35             addHeader(hdr.getName(), hdr.getValue());
36         }
37     }
38
39     private int getHeaderSize() {
40         int size = 0;
41         Iterator JavaDoc iterator = getAllHeaders();
42         while (iterator.hasNext()) {
43             iterator.next();
44             size++;
45         }
46         return size;
47     }
48 }
49
Popular Tags