View Javadoc

1   /* ***** BEGIN LICENSE BLOCK *****
2    * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3    *
4    * The contents of this file are subject to the Mozilla Public License Version
5    * 1.1 (the "License"); you may not use this file except in compliance with
6    * the License. You may obtain a copy of the License at
7    * http://www.mozilla.org/MPL/
8    *
9    * Software distributed under the License is distributed on an "AS IS" basis,
10   * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11   * for the specific language governing rights and limitations under the
12   * License.
13   *
14   * The Original Code is "SMS Library for the Java platform".
15   *
16   * The Initial Developer of the Original Code is Markus Eriksson.
17   * Portions created by the Initial Developer are Copyright (C) 2002
18   * the Initial Developer. All Rights Reserved.
19   *
20   * Contributor(s):
21   *
22   * Alternatively, the contents of this file may be used under the terms of
23   * either the GNU General Public License Version 2 or later (the "GPL"), or
24   * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
25   * in which case the provisions of the GPL or the LGPL are applicable instead
26   * of those above. If you wish to allow use of your version of this file only
27   * under the terms of either the GPL or the LGPL, and not to allow others to
28   * use your version of this file under the terms of the MPL, indicate your
29   * decision by deleting the provisions above and replace them with the notice
30   * and other provisions required by the GPL or the LGPL. If you do not delete
31   * the provisions above, a recipient may use your version of this file under
32   * the terms of any one of the MPL, the GPL or the LGPL.
33   *
34   * ***** END LICENSE BLOCK ***** */
35  package org.marre.wap.wbxml;
36  
37  public final class WbxmlConstants
38  {
39      /***
40       * Change the code page for the current token state. Followed by a single
41       * u_int8 indicating the new code page number.
42       */
43      public static final byte TOKEN_SWITCH_PAGE = 0x00;
44  
45      /*** Indicates the end of an attribute list or the end of an element. */
46      public static final byte TOKEN_END = 0x01;
47  
48      /***
49       * A character entity. Followed by a mb_u_int32 encoding the character
50       * entity number.
51       */
52      public static final byte TOKEN_ENTITY = 0x02;
53  
54      /*** Inline string. Followed by a termstr. */
55      public static final byte TOKEN_STR_I = 0x03;
56  
57      /***
58       * An unknown attribute name, or unknown tag posessing no attributes or
59       * content.Followed by a mb_u_int32 that encodes an offset into the string
60       * table.
61       */
62      public static final byte TOKEN_LITERAL = 0x04;
63  
64      /***
65       * Inline string document-type-specific extension token. Token is followed
66       * by a termstr.
67       */
68      public static final byte TOKEN_EXT_I_0 = 0x40;
69  
70      /***
71       * Inline string document-type-specific extension token. Token is followed
72       * by a termstr.
73       */
74      public static final byte TOKEN_EXT_I_1 = 0x41;
75  
76      /***
77       * Inline string document-type-specific extension token. Token is followed
78       * by a termstr.
79       */
80      public static final byte TOKEN_EXT_I_2 = 0x42;
81  
82      /*** Processing instruction. */
83      public static final byte TOKEN_PI = 0x43;
84  
85      /*** An unknown tag posessing content but no attributes. */
86      public static final byte TOKEN_LITERAL_C = 0x44;
87  
88      /***
89       * Inline integer document-type-specific extension token. Token is followed
90       * by a mb_u_int32.
91       */
92      public static final byte TOKEN_EXT_T_0 = (byte) 0x80;
93  
94      /***
95       * Inline integer document-type-specific extension token. Token is followed
96       * by a mb_u_int32.
97       */
98      public static final byte TOKEN_EXT_T_1 = (byte) 0x81;
99  
100     /***
101      * Inline integer document-type-specific extension token. Token is followed
102      * by a mb_u_int32.
103      */
104     public static final byte TOKEN_EXT_T_2 = (byte) 0x82;
105 
106     /***
107      * String table reference. Followed by a mb_u_int32 encoding a byte offset
108      * from the beginning of the string table.
109      */
110     public static final byte TOKEN_STR_T = (byte) 0x83;
111 
112     /*** An unknown tag posessing attributes but no content. */
113     public static final byte TOKEN_LITERAL_A = (byte) 0x84;
114 
115     /*** Single-byte document-type-specific extension token. */
116     public static final byte TOKEN_EXT_0 = (byte) 0xC0;
117 
118     /*** Single-byte document-type-specific extension token. */
119     public static final byte TOKEN_EXT_1 = (byte) 0xC1;
120 
121     /*** Single-byte document-type-specific extension token. */
122     public static final byte TOKEN_EXT_2 = (byte) 0xC2;
123 
124     /*** Opaque document-type-specific data. */
125     public static final byte TOKEN_OPAQ = (byte) 0xC3;
126 
127     /*** An unknown tag posessing both attributes and content. */
128     public static final byte TOKEN_LITERAL_AC = (byte) 0xC4;
129 
130     /*** Tag contains content. */
131     public static final byte TOKEN_KNOWN_C = (byte) 0x40;
132 
133     /*** Tag contains attributes. */
134     public static final byte TOKEN_KNOWN_A = (byte) 0x80;
135 
136     /*** Tag contains attributes. */
137     public static final byte TOKEN_KNOWN_AC = (byte) 0xC0;
138 
139     /*** Tag contains attributes. */
140     public static final byte TOKEN_KNOWN = (byte) 0x00;
141 
142     public static final String[] KNOWN_PUBLIC_DOCTYPES = {
143             // 0 String table index follows; public identifier is encoded as a literal
144             // in the string table.
145             // 1 Unknown or missing public identifier.
146             "-//WAPFORUM//DTD WML 1.0//EN", // (WML 1.0)
147             "-//WAPFORUM//DTD WTA 1.0//EN", // (Deprecated - WTA Event 1.0)
148             "-//WAPFORUM//DTD WML 1.1//EN", // (WML 1.1)
149             "-//WAPFORUM//DTD SI 1.0//EN", // (Service Indication 1.0)
150             "-//WAPFORUM//DTD SL 1.0//EN", // (Service Loading 1.0)
151             "-//WAPFORUM//DTD CO 1.0//EN", // (Cache Operation 1.0)
152             "-//WAPFORUM//DTD CHANNEL 1.1//EN", // (Channel 1.1)
153             "-//WAPFORUM//DTD WML 1.2//EN", // (WML 1.2)
154             "-//WAPFORUM//DTD WML 1.3//EN", // (WML 1.3)
155             "-//WAPFORUM//DTD PROV 1.0//EN", // (Provisioning 1.0)
156             "-//WAPFORUM//DTD WTA-WML 1.2//EN", // (WTA-WML 1.2)
157             "-//WAPFORUM//DTD EMN 1.0//EN", // (Email Notification 1.0 WAP-297)
158             "-//OMA//DTD DRMREL 1.0//EN", // (DRM REL 1.0)
159     };
160     
161     private WbxmlConstants()
162     {
163         // Utility class
164     }
165 }