KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > sync4j > server > notification > WapProvisioningDocWriter


1 /**
2  * Copyright (C) 2003-2005 Funambol
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17  */

18 package sync4j.server.notification;
19
20 import java.io.IOException JavaDoc;
21 import java.io.OutputStream JavaDoc;
22
23 import org.kxml.wap.Wbxml;
24 import org.kxml.wap.WbxmlWriter;
25
26
27
28 /**
29  * A parser for WapProvisioningDoc built on top of the WbxmlWriter
30  *
31  * @author Stefano Nichele @ Funambol
32  * @version $Id: WapProvisioningDocWriter.java,v 1.1 2005/05/16 17:32:57 nichele Exp $
33  */

34 public class WapProvisioningDocWriter extends WbxmlWriter {
35     // --------------------------------------------------------------- Constants
36

37     // ------------------------------------------------------------ Private data
38
private OutputStream JavaDoc out = null;
39
40     /**
41      * Calls constructor of WbxmlWriter, sets then the appropriate tag table
42      * @exception IOException if an error occurs
43      */

44     public WapProvisioningDocWriter(OutputStream JavaDoc out) throws IOException JavaDoc {
45         super(out);
46
47         this.out = out;
48
49         setTagTable(0, WapProvisioningDocWBXML.tagTable[0]);
50         setTagTable(1, WapProvisioningDocWBXML.tagTable[1]);
51
52         setAttrStartTable(0, WapProvisioningDocWBXML.attributeStartTable[0]);
53         setAttrStartTable(1, WapProvisioningDocWBXML.attributeStartTable[1]);
54
55         setAttrValueTable(0, WapProvisioningDocWBXML.paramValueTable[0]);
56         setAttrValueTable(1, WapProvisioningDocWBXML.paramValueTable[1]);
57     }
58
59
60     /**
61      * Writes out WBXML headers, override for other behaviour / values
62      *
63      * @exception IOException if an error occurs while writing
64      */

65     protected void writeHeader() throws IOException JavaDoc {
66         out.write(Wbxml.WBXML_VERSION_12 ); // version
67
out.write(0x0B); // public identifier
68
out.write(Wbxml.WBXML_CHARSET_UTF8); // UTF-8
69
}
70
71
72 }
Popular Tags