diff options
author | Elliott Hughes <enh@google.com> | 2009-11-13 18:10:06 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2009-11-13 18:10:06 -0800 |
commit | c78af99cf77739eff49596e8f249e45423e38ceb (patch) | |
tree | b6794da40b6d8cf52a03de25f602dc34b33f6771 /xml/src/main/java/org/kxml2 | |
parent | 25c2a2dcfb56959cf34e4e5e5496335be46c5e5c (diff) | |
download | libcore-c78af99cf77739eff49596e8f249e45423e38ceb.zip libcore-c78af99cf77739eff49596e8f249e45423e38ceb.tar.gz libcore-c78af99cf77739eff49596e8f249e45423e38ceb.tar.bz2 |
Remove org.kxml2.wap.
(Not to be submitted before d2944c35 in packages/apps/Email.)
Bug: 2249953
Diffstat (limited to 'xml/src/main/java/org/kxml2')
-rw-r--r-- | xml/src/main/java/org/kxml2/wap/Wbxml.java | 49 | ||||
-rw-r--r-- | xml/src/main/java/org/kxml2/wap/WbxmlParser.java | 1075 | ||||
-rw-r--r-- | xml/src/main/java/org/kxml2/wap/WbxmlSerializer.java | 559 | ||||
-rw-r--r-- | xml/src/main/java/org/kxml2/wap/syncml/SyncML.java | 192 | ||||
-rw-r--r-- | xml/src/main/java/org/kxml2/wap/wml/Wml.java | 233 | ||||
-rw-r--r-- | xml/src/main/java/org/kxml2/wap/wv/WV.java | 593 |
6 files changed, 0 insertions, 2701 deletions
diff --git a/xml/src/main/java/org/kxml2/wap/Wbxml.java b/xml/src/main/java/org/kxml2/wap/Wbxml.java deleted file mode 100644 index 5b0c2d3..0000000 --- a/xml/src/main/java/org/kxml2/wap/Wbxml.java +++ /dev/null @@ -1,49 +0,0 @@ -/* Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ - -package org.kxml2.wap; - - -/** contains the WBXML constants */ - - -public interface Wbxml { - - static public final int SWITCH_PAGE = 0; - static public final int END = 1; - static public final int ENTITY = 2; - static public final int STR_I = 3; - static public final int LITERAL = 4; - static public final int EXT_I_0 = 0x40; - static public final int EXT_I_1 = 0x41; - static public final int EXT_I_2 = 0x42; - static public final int PI = 0x43; - static public final int LITERAL_C = 0x44; - static public final int EXT_T_0 = 0x80; - static public final int EXT_T_1 = 0x81; - static public final int EXT_T_2 = 0x82; - static public final int STR_T = 0x83; - static public final int LITERAL_A = 0x084; - static public final int EXT_0 = 0x0c0; - static public final int EXT_1 = 0x0c1; - static public final int EXT_2 = 0x0c2; - static public final int OPAQUE = 0x0c3; - static public final int LITERAL_AC = 0x0c4; -} diff --git a/xml/src/main/java/org/kxml2/wap/WbxmlParser.java b/xml/src/main/java/org/kxml2/wap/WbxmlParser.java deleted file mode 100644 index 617e1d4..0000000 --- a/xml/src/main/java/org/kxml2/wap/WbxmlParser.java +++ /dev/null @@ -1,1075 +0,0 @@ -/* Copyright (c) 2002,2003,2004 Stefan Haustein, Oberhausen, Rhld., Germany - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ - -// Contributors: Bjorn Aadland, Chris Bartley, Nicola Fankhauser, -// Victor Havin, Christian Kurzke, Bogdan Onoiu, -// Elias Ross, Jain Sanjay, David Santoro. - -package org.kxml2.wap; - -import java.io.*; -import java.util.Vector; -import java.util.Hashtable; - -import org.xmlpull.v1.*; - - -public class WbxmlParser implements XmlPullParser { - - static final String HEX_DIGITS = "0123456789abcdef"; - - /** Parser event type for Wbxml-specific events. The Wbxml event code can be - * accessed with getWapCode() */ - - public static final int WAP_EXTENSION = 64; - - static final private String UNEXPECTED_EOF = - "Unexpected EOF"; - static final private String ILLEGAL_TYPE = - "Wrong event type"; - - private InputStream in; - - private int TAG_TABLE = 0; - private int ATTR_START_TABLE = 1; - private int ATTR_VALUE_TABLE = 2; - - private String[] attrStartTable; - private String[] attrValueTable; - private String[] tagTable; - private byte[] stringTable; - private Hashtable cacheStringTable = null; - private boolean processNsp; - - private int depth; - private String[] elementStack = new String[16]; - private String[] nspStack = new String[8]; - private int[] nspCounts = new int[4]; - - private int attributeCount; - private String[] attributes = new String[16]; - private int nextId = -2; - - private Vector tables = new Vector(); - - private int version; - private int publicIdentifierId; - - // StartTag current; - // ParseEvent next; - - private String prefix; - private String namespace; - private String name; - private String text; - - private Object wapExtensionData; - private int wapCode; - - private int type; - - private boolean degenerated; - private boolean isWhitespace; - private String encoding; - - public boolean getFeature(String feature) { - if (XmlPullParser - .FEATURE_PROCESS_NAMESPACES - .equals(feature)) - return processNsp; - else - return false; - } - - public String getInputEncoding() { - return encoding; - } - - public void defineEntityReplacementText( - String entity, - String value) - throws XmlPullParserException { - - // just ignore, has no effect - } - - public Object getProperty(String property) { - return null; - } - - public int getNamespaceCount(int depth) { - if (depth > this.depth) - throw new IndexOutOfBoundsException(); - return nspCounts[depth]; - } - - public String getNamespacePrefix(int pos) { - return nspStack[pos << 1]; - } - - public String getNamespaceUri(int pos) { - return nspStack[(pos << 1) + 1]; - } - - public String getNamespace(String prefix) { - - if ("xml".equals(prefix)) - return "http://www.w3.org/XML/1998/namespace"; - if ("xmlns".equals(prefix)) - return "http://www.w3.org/2000/xmlns/"; - - for (int i = (getNamespaceCount(depth) << 1) - 2; - i >= 0; - i -= 2) { - if (prefix == null) { - if (nspStack[i] == null) - return nspStack[i + 1]; - } - else if (prefix.equals(nspStack[i])) - return nspStack[i + 1]; - } - return null; - } - - public int getDepth() { - return depth; - } - - public String getPositionDescription() { - - StringBuffer buf = - new StringBuffer( - type < TYPES.length ? TYPES[type] : "unknown"); - buf.append(' '); - - if (type == START_TAG || type == END_TAG) { - if (degenerated) - buf.append("(empty) "); - buf.append('<'); - if (type == END_TAG) - buf.append('/'); - - if (prefix != null) - buf.append("{" + namespace + "}" + prefix + ":"); - buf.append(name); - - int cnt = attributeCount << 2; - for (int i = 0; i < cnt; i += 4) { - buf.append(' '); - if (attributes[i + 1] != null) - buf.append( - "{" - + attributes[i] - + "}" - + attributes[i - + 1] - + ":"); - buf.append( - attributes[i - + 2] - + "='" - + attributes[i - + 3] - + "'"); - } - - buf.append('>'); - } - else if (type == IGNORABLE_WHITESPACE); - else if (type != TEXT) - buf.append(getText()); - else if (isWhitespace) - buf.append("(whitespace)"); - else { - String text = getText(); - if (text.length() > 16) - text = text.substring(0, 16) + "..."; - buf.append(text); - } - - return buf.toString(); - } - - public int getLineNumber() { - return -1; - } - - public int getColumnNumber() { - return -1; - } - - public boolean isWhitespace() - throws XmlPullParserException { - if (type != TEXT - && type != IGNORABLE_WHITESPACE - && type != CDSECT) - exception(ILLEGAL_TYPE); - return isWhitespace; - } - - public String getText() { - return text; - } - - public char[] getTextCharacters(int[] poslen) { - if (type >= TEXT) { - poslen[0] = 0; - poslen[1] = text.length(); - char[] buf = new char[text.length()]; - text.getChars(0, text.length(), buf, 0); - return buf; - } - - poslen[0] = -1; - poslen[1] = -1; - return null; - } - - public String getNamespace() { - return namespace; - } - - public String getName() { - return name; - } - - public String getPrefix() { - return prefix; - } - - public boolean isEmptyElementTag() - throws XmlPullParserException { - if (type != START_TAG) - exception(ILLEGAL_TYPE); - return degenerated; - } - - public int getAttributeCount() { - return attributeCount; - } - - public String getAttributeType(int index) { - return "CDATA"; - } - - public boolean isAttributeDefault(int index) { - return false; - } - - public String getAttributeNamespace(int index) { - if (index >= attributeCount) - throw new IndexOutOfBoundsException(); - return attributes[index << 2]; - } - - public String getAttributeName(int index) { - if (index >= attributeCount) - throw new IndexOutOfBoundsException(); - return attributes[(index << 2) + 2]; - } - - public String getAttributePrefix(int index) { - if (index >= attributeCount) - throw new IndexOutOfBoundsException(); - return attributes[(index << 2) + 1]; - } - - public String getAttributeValue(int index) { - if (index >= attributeCount) - throw new IndexOutOfBoundsException(); - return attributes[(index << 2) + 3]; - } - - public String getAttributeValue( - String namespace, - String name) { - - for (int i = (attributeCount << 2) - 4; - i >= 0; - i -= 4) { - if (attributes[i + 2].equals(name) - && (namespace == null - || attributes[i].equals(namespace))) - return attributes[i + 3]; - } - - return null; - } - - public int getEventType() throws XmlPullParserException { - return type; - } - - - // TODO: Reuse resolveWapExtension here? Raw Wap extensions would still be accessible - // via nextToken(); ....? - - public int next() throws XmlPullParserException, IOException { - - isWhitespace = true; - int minType = 9999; - - while (true) { - - String save = text; - - nextImpl(); - - if (type < minType) - minType = type; - - if (minType > CDSECT) continue; // no "real" event so far - - if (minType >= TEXT) { // text, see if accumulate - - if (save != null) text = text == null ? save : save + text; - - switch(peekId()) { - case Wbxml.ENTITY: - case Wbxml.STR_I: - case Wbxml.STR_T: - case Wbxml.LITERAL: - case Wbxml.LITERAL_C: - case Wbxml.LITERAL_A: - case Wbxml.LITERAL_AC: continue; - } - } - - break; - } - - type = minType; - - if (type > TEXT) - type = TEXT; - - return type; - } - - - public int nextToken() throws XmlPullParserException, IOException { - - isWhitespace = true; - nextImpl(); - return type; - } - - - - public int nextTag() throws XmlPullParserException, IOException { - - next(); - if (type == TEXT && isWhitespace) - next(); - - if (type != END_TAG && type != START_TAG) - exception("unexpected type"); - - return type; - } - - - public String nextText() throws XmlPullParserException, IOException { - if (type != START_TAG) - exception("precondition: START_TAG"); - - next(); - - String result; - - if (type == TEXT) { - result = getText(); - next(); - } - else - result = ""; - - if (type != END_TAG) - exception("END_TAG expected"); - - return result; - } - - - public void require(int type, String namespace, String name) - throws XmlPullParserException, IOException { - - if (type != this.type - || (namespace != null && !namespace.equals(getNamespace())) - || (name != null && !name.equals(getName()))) - exception( - "expected: " + (type == WAP_EXTENSION ? "WAP Ext." : (TYPES[type] + " {" + namespace + "}" + name))); - } - - - public void setInput(Reader reader) throws XmlPullParserException { - exception("InputStream required"); - } - - public void setInput(InputStream in, String enc) - throws XmlPullParserException { - - this.in = in; - - try { - version = readByte(); - publicIdentifierId = readInt(); - - if (publicIdentifierId == 0) - readInt(); - - int charset = readInt(); // skip charset - - if (null == enc){ - switch (charset){ - case 4: encoding = "ISO-8859-1"; break; - case 106: encoding = "UTF-8"; break; - // add more if you need them - // http://www.iana.org/assignments/character-sets - // case MIBenum: encoding = Name break; - default: throw new UnsupportedEncodingException(""+charset); - } - }else{ - encoding = enc; - } - - int strTabSize = readInt(); - stringTable = new byte[strTabSize]; - - int ok = 0; - while(ok < strTabSize){ - int cnt = in.read(stringTable, ok, strTabSize - ok); - if(cnt <= 0) break; - ok += cnt; - } - - selectPage(0, true); - selectPage(0, false); - } - catch (IOException e) { - exception("Illegal input format"); - } - } - - public void setFeature(String feature, boolean value) - throws XmlPullParserException { - if (XmlPullParser.FEATURE_PROCESS_NAMESPACES.equals(feature)) - processNsp = value; - else - exception("unsupported feature: " + feature); - } - - public void setProperty(String property, Object value) - throws XmlPullParserException { - throw new XmlPullParserException("unsupported property: " + property); - } - - // ---------------------- private / internal methods - - private final boolean adjustNsp() - throws XmlPullParserException { - - boolean any = false; - - for (int i = 0; i < attributeCount << 2; i += 4) { - // * 4 - 4; i >= 0; i -= 4) { - - String attrName = attributes[i + 2]; - int cut = attrName.indexOf(':'); - String prefix; - - if (cut != -1) { - prefix = attrName.substring(0, cut); - attrName = attrName.substring(cut + 1); - } - else if (attrName.equals("xmlns")) { - prefix = attrName; - attrName = null; - } - else - continue; - - if (!prefix.equals("xmlns")) { - any = true; - } - else { - int j = (nspCounts[depth]++) << 1; - - nspStack = ensureCapacity(nspStack, j + 2); - nspStack[j] = attrName; - nspStack[j + 1] = attributes[i + 3]; - - if (attrName != null - && attributes[i + 3].equals("")) - exception("illegal empty namespace"); - - // prefixMap = new PrefixMap (prefixMap, attrName, attr.getValue ()); - - //System.out.println (prefixMap); - - System.arraycopy( - attributes, - i + 4, - attributes, - i, - ((--attributeCount) << 2) - i); - - i -= 4; - } - } - - if (any) { - for (int i = (attributeCount << 2) - 4; - i >= 0; - i -= 4) { - - String attrName = attributes[i + 2]; - int cut = attrName.indexOf(':'); - - if (cut == 0) - throw new RuntimeException( - "illegal attribute name: " - + attrName - + " at " - + this); - - else if (cut != -1) { - String attrPrefix = - attrName.substring(0, cut); - - attrName = attrName.substring(cut + 1); - - String attrNs = getNamespace(attrPrefix); - - if (attrNs == null) - throw new RuntimeException( - "Undefined Prefix: " - + attrPrefix - + " in " - + this); - - attributes[i] = attrNs; - attributes[i + 1] = attrPrefix; - attributes[i + 2] = attrName; - - for (int j = (attributeCount << 2) - 4; - j > i; - j -= 4) - if (attrName.equals(attributes[j + 2]) - && attrNs.equals(attributes[j])) - exception( - "Duplicate Attribute: {" - + attrNs - + "}" - + attrName); - } - } - } - - int cut = name.indexOf(':'); - - if (cut == 0) - exception("illegal tag name: " + name); - else if (cut != -1) { - prefix = name.substring(0, cut); - name = name.substring(cut + 1); - } - - this.namespace = getNamespace(prefix); - - if (this.namespace == null) { - if (prefix != null) - exception("undefined prefix: " + prefix); - this.namespace = NO_NAMESPACE; - } - - return any; - } - - private final void setTable(int page, int type, String[] table) { - if(stringTable != null){ - throw new RuntimeException("setXxxTable must be called before setInput!"); - } - while(tables.size() < 3*page +3){ - tables.addElement(null); - } - tables.setElementAt(table, page*3+type); - } - - - - - - private final void exception(String desc) - throws XmlPullParserException { - throw new XmlPullParserException(desc, this, null); - } - - - private void selectPage(int nr, boolean tags) throws XmlPullParserException{ - if(tables.size() == 0 && nr == 0) return; - - if(nr*3 > tables.size()) - exception("Code Page "+nr+" undefined!"); - - if(tags) - tagTable = (String[]) tables.elementAt(nr * 3 + TAG_TABLE); - else { - attrStartTable = (String[]) tables.elementAt(nr * 3 + ATTR_START_TABLE); - attrValueTable = (String[]) tables.elementAt(nr * 3 + ATTR_VALUE_TABLE); - } - } - - private final void nextImpl() - throws IOException, XmlPullParserException { - - String s; - - if (type == END_TAG) { - depth--; - } - - if (degenerated) { - type = XmlPullParser.END_TAG; - degenerated = false; - return; - } - - text = null; - prefix = null; - name = null; - - int id = peekId (); - while(id == Wbxml.SWITCH_PAGE){ - nextId = -2; - selectPage(readByte(), true); - id = peekId(); - } - nextId = -2; - - switch (id) { - case -1 : - type = XmlPullParser.END_DOCUMENT; - break; - - case Wbxml.END : - { - int sp = (depth - 1) << 2; - - type = END_TAG; - namespace = elementStack[sp]; - prefix = elementStack[sp + 1]; - name = elementStack[sp + 2]; - } - break; - - case Wbxml.ENTITY : - { - type = ENTITY_REF; - char c = (char) readInt(); - text = "" + c; - name = "#" + ((int) c); - } - - break; - - case Wbxml.STR_I : - type = TEXT; - text = readStrI(); - break; - - case Wbxml.EXT_I_0 : - case Wbxml.EXT_I_1 : - case Wbxml.EXT_I_2 : - case Wbxml.EXT_T_0 : - case Wbxml.EXT_T_1 : - case Wbxml.EXT_T_2 : - case Wbxml.EXT_0 : - case Wbxml.EXT_1 : - case Wbxml.EXT_2 : - case Wbxml.OPAQUE : - - type = WAP_EXTENSION; - wapCode = id; - wapExtensionData = parseWapExtension(id); - break; - - case Wbxml.PI : - throw new RuntimeException("PI curr. not supp."); - // readPI; - // break; - - case Wbxml.STR_T : - { - type = TEXT; - text = readStrT(); - } - break; - - default : - parseElement(id); - } - // } - // while (next == null); - - // return next; - } - - /** Overwrite this method to intercept all wap events */ - - public Object parseWapExtension(int id) throws IOException, XmlPullParserException { - - switch (id) { - case Wbxml.EXT_I_0 : - case Wbxml.EXT_I_1 : - case Wbxml.EXT_I_2 : - return readStrI(); - - case Wbxml.EXT_T_0 : - case Wbxml.EXT_T_1 : - case Wbxml.EXT_T_2 : - return new Integer(readInt()); - - case Wbxml.EXT_0 : - case Wbxml.EXT_1 : - case Wbxml.EXT_2 : - return null; - - case Wbxml.OPAQUE : - { - int count = readInt(); - byte[] buf = new byte[count]; - - while(count > 0){ - count -= in.read(buf, buf.length-count, count); - } - - return buf; - } // case OPAQUE - - - default: - exception("illegal id: "+id); - return null; // dead code - } // SWITCH - } - - public void readAttr() throws IOException, XmlPullParserException { - - int id = readByte(); - int i = 0; - - while (id != 1) { - - while(id == Wbxml.SWITCH_PAGE){ - selectPage(readByte(), false); - id = readByte(); - } - - String name = resolveId(attrStartTable, id); - StringBuffer value; - - int cut = name.indexOf('='); - - if (cut == -1) - value = new StringBuffer(); - else { - value = - new StringBuffer(name.substring(cut + 1)); - name = name.substring(0, cut); - } - - id = readByte(); - while (id > 128 - || id == Wbxml.SWITCH_PAGE - || id == Wbxml.ENTITY - || id == Wbxml.STR_I - || id == Wbxml.STR_T - || (id >= Wbxml.EXT_I_0 && id <= Wbxml.EXT_I_2) - || (id >= Wbxml.EXT_T_0 && id <= Wbxml.EXT_T_2)) { - - switch (id) { - case Wbxml.SWITCH_PAGE : - selectPage(readByte(), false); - break; - - case Wbxml.ENTITY : - value.append((char) readInt()); - break; - - case Wbxml.STR_I : - value.append(readStrI()); - break; - - case Wbxml.EXT_I_0 : - case Wbxml.EXT_I_1 : - case Wbxml.EXT_I_2 : - case Wbxml.EXT_T_0 : - case Wbxml.EXT_T_1 : - case Wbxml.EXT_T_2 : - case Wbxml.EXT_0 : - case Wbxml.EXT_1 : - case Wbxml.EXT_2 : - case Wbxml.OPAQUE : - value.append(resolveWapExtension(id, parseWapExtension(id))); - break; - - case Wbxml.STR_T : - value.append(readStrT()); - break; - - default : - value.append( - resolveId(attrValueTable, id)); - } - - id = readByte(); - } - - attributes = ensureCapacity(attributes, i + 4); - - attributes[i++] = ""; - attributes[i++] = null; - attributes[i++] = name; - attributes[i++] = value.toString(); - - attributeCount++; - } - } - - private int peekId () throws IOException { - if (nextId == -2) { - nextId = in.read (); - } - return nextId; - } - - /** overwrite for own WAP extension handling in attributes and high level parsing - * (above nextToken() level) */ - - protected String resolveWapExtension(int id, Object data){ - - if(data instanceof byte[]){ - StringBuffer sb = new StringBuffer(); - byte[] b = (byte[]) data; - - for (int i = 0; i < b.length; i++) { - sb.append(HEX_DIGITS.charAt((b[i] >> 4) & 0x0f)); - sb.append(HEX_DIGITS.charAt(b[i] & 0x0f)); - } - return sb.toString(); - } - - return "$("+data+")"; - } - - String resolveId(String[] tab, int id) throws IOException { - int idx = (id & 0x07f) - 5; - if (idx == -1){ - wapCode = -1; - return readStrT(); - } - if (idx < 0 - || tab == null - || idx >= tab.length - || tab[idx] == null) - throw new IOException("id " + id + " undef."); - - wapCode = idx+5; - - return tab[idx]; - } - - void parseElement(int id) - throws IOException, XmlPullParserException { - - type = START_TAG; - name = resolveId(tagTable, id & 0x03f); - - attributeCount = 0; - if ((id & 128) != 0) { - readAttr(); - } - - degenerated = (id & 64) == 0; - - int sp = depth++ << 2; - - // transfer to element stack - - elementStack = ensureCapacity(elementStack, sp + 4); - elementStack[sp + 3] = name; - - if (depth >= nspCounts.length) { - int[] bigger = new int[depth + 4]; - System.arraycopy(nspCounts, 0, bigger, 0, nspCounts.length); - nspCounts = bigger; - } - - nspCounts[depth] = nspCounts[depth - 1]; - - for (int i = attributeCount - 1; i > 0; i--) { - for (int j = 0; j < i; j++) { - if (getAttributeName(i) - .equals(getAttributeName(j))) - exception( - "Duplicate Attribute: " - + getAttributeName(i)); - } - } - - if (processNsp) - adjustNsp(); - else - namespace = ""; - - elementStack[sp] = namespace; - elementStack[sp + 1] = prefix; - elementStack[sp + 2] = name; - - } - - private final String[] ensureCapacity( - String[] arr, - int required) { - if (arr.length >= required) - return arr; - String[] bigger = new String[required + 16]; - System.arraycopy(arr, 0, bigger, 0, arr.length); - return bigger; - } - - int readByte() throws IOException { - int i = in.read(); - if (i == -1) - throw new IOException("Unexpected EOF"); - return i; - } - - int readInt() throws IOException { - int result = 0; - int i; - - do { - i = readByte(); - result = (result << 7) | (i & 0x7f); - } - while ((i & 0x80) != 0); - - return result; - } - - String readStrI() throws IOException { - ByteArrayOutputStream buf = new ByteArrayOutputStream(); - boolean wsp = true; - while (true){ - int i = in.read(); - if (i == 0){ - break; - } - if (i == -1){ - throw new IOException(UNEXPECTED_EOF); - } - if (i > 32){ - wsp = false; - } - buf.write(i); - } - isWhitespace = wsp; - String result = new String(buf.toByteArray(), encoding); - buf.close(); - return result; - } - - String readStrT() throws IOException { - int pos = readInt(); - // As the main reason of stringTable is compression we build a cache of Strings - // stringTable is supposed to help create Strings from parts which means some cache hit rate - // This will help to minimize the Strings created when invoking readStrT() repeatedly - if (cacheStringTable == null){ - //Lazy init if device is not using StringTable but inline 0x03 strings - cacheStringTable = new Hashtable(); - } - String forReturn = (String) cacheStringTable.get(new Integer(pos)); - if (forReturn == null){ - - int end = pos; - while(end < stringTable.length && stringTable[end] != '\0'){ - end++; - } - forReturn = new String(stringTable, pos, end-pos, encoding); - cacheStringTable.put(new Integer(pos), forReturn); - } - return forReturn; - } - - /** - * Sets the tag table for a given page. - * The first string in the array defines tag 5, the second tag 6 etc. - */ - - public void setTagTable(int page, String[] table) { - setTable(page, TAG_TABLE, table); - - // this.tagTable = tagTable; - // if (page != 0) - // throw new RuntimeException("code pages curr. not supp."); - } - - /** Sets the attribute start Table for a given page. - * The first string in the array defines attribute - * 5, the second attribute 6 etc. Please use the - * character '=' (without quote!) as delimiter - * between the attribute name and the (start of the) value - */ - - public void setAttrStartTable( - int page, - String[] table) { - - setTable(page, ATTR_START_TABLE, table); - } - - /** Sets the attribute value Table for a given page. - * The first string in the array defines attribute value 0x85, - * the second attribute value 0x86 etc. - */ - - public void setAttrValueTable( - int page, - String[] table) { - - setTable(page, ATTR_VALUE_TABLE, table); - } - - /** Returns the token ID for start tags or the event type for wap proprietary events - * such as OPAQUE. - */ - - public int getWapCode(){ - return wapCode; - } - - public Object getWapExtensionData(){ - return wapExtensionData; - } - - -} diff --git a/xml/src/main/java/org/kxml2/wap/WbxmlSerializer.java b/xml/src/main/java/org/kxml2/wap/WbxmlSerializer.java deleted file mode 100644 index a977386..0000000 --- a/xml/src/main/java/org/kxml2/wap/WbxmlSerializer.java +++ /dev/null @@ -1,559 +0,0 @@ -/* Copyright (c) 2002,2003, Stefan Haustein, Oberhausen, Rhld., Germany - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or - * sell copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. */ - -//Contributors: Jonathan Cox, Bogdan Onoiu, Jerry Tian - -package org.kxml2.wap; - -import java.io.*; -import java.util.*; - -import org.xmlpull.v1.*; - -// TODO: make some of the "direct" WBXML token writing methods public?? - -/** - * A class for writing WBXML. Does not support namespaces yet. - */ -public class WbxmlSerializer implements XmlSerializer { - - - Hashtable stringTable = new Hashtable(); - - OutputStream out; - - ByteArrayOutputStream buf = new ByteArrayOutputStream(); - ByteArrayOutputStream stringTableBuf = new ByteArrayOutputStream(); - - String pending; - int depth; - String name; - String namespace; - Vector attributes = new Vector(); - - Hashtable attrStartTable = new Hashtable(); - Hashtable attrValueTable = new Hashtable(); - Hashtable tagTable = new Hashtable(); - - private int attrPage; - private int tagPage; - - private String encoding; - - private boolean headerSent = false; - - /** - * Write an attribute. - * Calls to attribute() MUST follow a call to startTag() immediately. - * If there is no prefix defined for the given namespace, - * a prefix will be defined automatically. - */ - public XmlSerializer attribute(String namespace, String name, String value) { - attributes.addElement(name); - attributes.addElement(value); - return this; - } - - - public void cdsect (String cdsect) throws IOException{ - text (cdsect); - } - - /** - * Add comment. Ignore for WBXML. - */ - public void comment (String comment) { - // silently ignore comment - } - - /** - * Docdecl isn't supported for WBXML. - */ - public void docdecl (String docdecl) { - throw new RuntimeException ("Cannot write docdecl for WBXML"); - } - - /** - * EntityReference not supported for WBXML. - */ - public void entityRef (String er) { - throw new RuntimeException ("EntityReference not supported for WBXML"); - } - - /** - * Return current tag depth. - */ - public int getDepth() { - return depth; - } - - /** - * Return the current value of the feature with given name. - */ - public boolean getFeature (String name) { - return false; - } - - /** - * Returns the namespace URI of the current element as set by startTag(). - * Namespaces is not yet implemented. - */ - public String getNamespace() { - // Namespaces is not yet implemented. So only null can be setted - return null; - } - - /** - * Returns the name of the current element as set by startTag(). - * It can only be null before first call to startTag() or when last endTag() - * is called to close first startTag(). - */ - public String getName() { - return pending; - } - - /** - * Prefix for namespace not supported for WBXML. Not yet implemented. - */ - public String getPrefix(String nsp, boolean create) { - throw new RuntimeException ("NYI"); - } - - /** - * Look up the value of a property. - * @param name The name of property. Name is any fully-qualified URI. - * @return The value of named property. - */ - public Object getProperty (String name) { - return null; - } - - public void ignorableWhitespace (String sp) { - } - - /** - * Finish writing. - * All unclosed start tags will be closed and output will be flushed. - * After calling this method no more output can be serialized until - * next call to setOutput(). - */ - public void endDocument() throws IOException { - flush(); - } - - /** - * Write all pending output to the stream. - * After first call string table willn't be used and you can't add tag - * which is not in tag table. - */ - public void flush() throws IOException { - checkPending(false); - - if (!headerSent) { - writeInt(out, stringTableBuf.size()); - out.write(stringTableBuf.toByteArray()); - headerSent = true; - } - - out.write(buf.toByteArray()); - buf.reset(); - } - - public void checkPending(boolean degenerated) throws IOException { - if (pending == null) - return; - - int len = attributes.size(); - - int[] idx = (int[]) tagTable.get(pending); - - // if no entry in known table, then add as literal - if (idx == null) { - buf.write(len == 0 - ? (degenerated ? Wbxml.LITERAL : Wbxml.LITERAL_C) - : (degenerated ? Wbxml.LITERAL_A : Wbxml.LITERAL_AC)); - - writeStrT(pending, false); - } else { - if(idx[0] != tagPage){ - tagPage=idx[0]; - buf.write(Wbxml.SWITCH_PAGE); - buf.write(tagPage); - } - buf.write(len == 0 - ? (degenerated ? idx[1] : idx[1] | 64) - : (degenerated ? idx[1] | 128 : idx[1] | 192)); - } - - for (int i = 0; i < len;) { - idx = (int[]) attrStartTable.get(attributes.elementAt(i)); - - if (idx == null) { - buf.write(Wbxml.LITERAL); - writeStrT((String) attributes.elementAt(i), false); - } - else { - if(idx[0] != attrPage){ - attrPage = idx[0]; - buf.write(0); - buf.write(attrPage); - } - buf.write(idx[1]); - } - idx = (int[]) attrValueTable.get(attributes.elementAt(++i)); - if (idx == null) { - writeStr((String) attributes.elementAt(i)); - } - else { - if(idx[0] != attrPage){ - attrPage = idx[0]; - buf.write(0); - buf.write(attrPage); - } - buf.write(idx[1]); - } - ++i; - } - - if (len > 0) - buf.write(Wbxml.END); - - pending = null; - attributes.removeAllElements(); - } - - /** - * Not Yet Implemented. - */ - public void processingInstruction(String pi) { - throw new RuntimeException ("PI NYI"); - } - - /** - * Set feature identified by name. There are no supported functions. - */ - public void setFeature(String name, boolean value) { - throw new IllegalArgumentException ("unknown feature "+name); - } - - /** - * Set the output to the given writer. Wbxml requires an OutputStream. - */ - public void setOutput (Writer writer) { - throw new RuntimeException ("Wbxml requires an OutputStream!"); - } - - /** - * Set to use binary output stream with given encoding. - */ - public void setOutput (OutputStream out, String encoding) throws IOException { - - this.encoding = encoding == null ? "UTF-8" : encoding; - this.out = out; - - buf = new ByteArrayOutputStream(); - stringTableBuf = new ByteArrayOutputStream(); - headerSent = false; - - // ok, write header - } - - /** - * Binds the given prefix to the given namespace. Not yet implemented. - */ - public void setPrefix(String prefix, String nsp) { - throw new RuntimeException("NYI"); - } - - /** - * Set the value of a property. There are no supported properties. - */ - public void setProperty(String property, Object value) { - throw new IllegalArgumentException ("unknown property "+property); - } - - /** - * Write version and encoding information. - * This method can only be called just after setOutput. - * @param encoding Document encoding. Default is UTF-8. - * @param standalone Not used in WBXML. - */ - public void startDocument(String encoding, Boolean standalone) throws IOException { - out.write(0x03); // version 1.3 - // http://www.openmobilealliance.org/tech/omna/omna-wbxml-public-docid.htm - out.write(0x01); // unknown or missing public identifier - - // default encoding is UTF-8 - - if(encoding != null){ - this.encoding = encoding; - } - - if (this.encoding.toUpperCase().equals("UTF-8")){ - out.write(106); - }else if (this.encoding.toUpperCase().equals("ISO-8859-1")){ - out.write(0x04); - }else{ - throw new UnsupportedEncodingException(encoding); - } - } - - - public XmlSerializer startTag(String namespace, String name) throws IOException { - - if (namespace != null && !"".equals(namespace)) - throw new RuntimeException ("NSP NYI"); - - //current = new State(current, prefixMap, name); - - checkPending(false); - pending = name; - depth++; - - return this; - } - - public XmlSerializer text(char[] chars, int start, int len) throws IOException { - checkPending(false); - writeStr(new String(chars, start, len)); - return this; - } - - public XmlSerializer text(String text) throws IOException { - checkPending(false); - writeStr(text); - return this; - } - - /** - * Used in text() and attribute() to write text. - */ - private void writeStr(String text) throws IOException{ - int p0 = 0; - int lastCut = 0; - int len = text.length(); - - if (headerSent) { - writeStrI(buf, text); - return; - } - - while(p0 < len){ - while(p0 < len && text.charAt(p0) < 'A' ){ // skip interpunctation - p0++; - } - int p1 = p0; - while (p1 < len && text.charAt(p1) >= 'A'){ - p1++; - } - - if (p1 - p0 > 10) { - if (p0 > lastCut && text.charAt(p0-1) == ' ' - && stringTable.get(text.substring(p0, p1)) == null){ - buf.write(Wbxml.STR_T); - writeStrT(text.substring(lastCut, p1), false); - } - else { - if(p0 > lastCut && text.charAt(p0-1) == ' '){ - p0--; - } - - if(p0 > lastCut){ - buf.write(Wbxml.STR_T); - writeStrT(text.substring(lastCut, p0), false); - } - buf.write(Wbxml.STR_T); - writeStrT(text.substring(p0, p1), true); - } - lastCut = p1; - } - p0 = p1; - } - - if(lastCut < len){ - buf.write(Wbxml.STR_T); - writeStrT(text.substring(lastCut, len), false); - } - } - - - - public XmlSerializer endTag(String namespace, String name) throws IOException { - // current = current.prev; - if (pending != null) { - checkPending(true); - } else { - buf.write(Wbxml.END); - } - depth--; - return this; - } - - /** - * @throws IOException - */ - public void writeWapExtension(int type, Object data) throws IOException { - checkPending(false); - buf.write(type); - switch(type){ - case Wbxml.EXT_0: - case Wbxml.EXT_1: - case Wbxml.EXT_2: - break; - - case Wbxml.OPAQUE: - byte[] bytes = (byte[]) data; - writeInt(buf, bytes.length); - buf.write(bytes); - break; - - case Wbxml.EXT_I_0: - case Wbxml.EXT_I_1: - case Wbxml.EXT_I_2: - writeStrI(buf, (String) data); - break; - - case Wbxml.EXT_T_0: - case Wbxml.EXT_T_1: - case Wbxml.EXT_T_2: - writeStrT((String) data, false); - break; - - default: - throw new IllegalArgumentException(); - } - } - - // ------------- internal methods -------------------------- - - static void writeInt(OutputStream out, int i) throws IOException { - byte[] buf = new byte[5]; - int idx = 0; - - do { - buf[idx++] = (byte) (i & 0x7f); - i = i >> 7; - } - while (i != 0); - - while (idx > 1) { - out.write(buf[--idx] | 0x80); - } - out.write(buf[0]); - } - - void writeStrI(OutputStream out, String s) throws IOException { - byte[] data = s.getBytes(encoding); - out.write(data); - out.write(0); - } - - private final void writeStrT(String s, boolean mayPrependSpace) throws IOException { - - Integer idx = (Integer) stringTable.get(s); - writeInt(buf, idx == null - ? addToStringTable(s, mayPrependSpace) - : idx.intValue()); - } - - - /** - * Add string to string table. Not permitted after string table has been flushed. - * - * @param s string to be added to the string table - * @param mayPrependSpace is set, a space is prepended to the string to archieve better compression results - * @return offset of s in the string table - */ - public int addToStringTable(String s, boolean mayPrependSpace) throws IOException { - if (headerSent) { - throw new IOException("stringtable sent"); - } - - int i = stringTableBuf.size(); - int offset = i; - if(s.charAt(0) >= '0' && mayPrependSpace){ - s = ' ' + s; - offset++; - } - - stringTable.put(s, new Integer(i)); - if(s.charAt(0) == ' '){ - stringTable.put(s.substring(1), new Integer(i+1)); - } - int j = s.lastIndexOf(' '); - if(j > 1){ - stringTable.put(s.substring(j), new Integer(i+j)); - stringTable.put(s.substring(j+1), new Integer(i+j+1)); - } - - writeStrI(stringTableBuf, s); - stringTableBuf.flush(); - return offset; - } - - /** - * Sets the tag table for a given page. - * The first string in the array defines tag 5, the second tag 6 etc. - */ - public void setTagTable(int page, String[] tagTable) { - // TODO: clear entries in tagTable? - - for (int i = 0; i < tagTable.length; i++) { - if (tagTable[i] != null) { - Object idx = new int[]{page, i+5}; - this.tagTable.put(tagTable[i], idx); - } - } - } - - /** - * Sets the attribute start Table for a given page. - * The first string in the array defines attribute - * 5, the second attribute 6 etc. - * Please use the - * character '=' (without quote!) as delimiter - * between the attribute name and the (start of the) value - */ - public void setAttrStartTable(int page, String[] attrStartTable) { - - for (int i = 0; i < attrStartTable.length; i++) { - if (attrStartTable[i] != null) { - Object idx = new int[] {page, i + 5}; - this.attrStartTable.put(attrStartTable[i], idx); - } - } - } - - /** - * Sets the attribute value Table for a given page. - * The first string in the array defines attribute value 0x85, - * the second attribute value 0x86 etc. - * Must be called BEFORE use attribute(), flush() etc. - */ - public void setAttrValueTable(int page, String[] attrValueTable) { - // clear entries in this.table! - for (int i = 0; i < attrValueTable.length; i++) { - if (attrValueTable[i] != null) { - Object idx = new int[]{page, i + 0x085}; - this.attrValueTable.put(attrValueTable[i], idx); - } - } - } -} diff --git a/xml/src/main/java/org/kxml2/wap/syncml/SyncML.java b/xml/src/main/java/org/kxml2/wap/syncml/SyncML.java deleted file mode 100644 index 5ea8496..0000000 --- a/xml/src/main/java/org/kxml2/wap/syncml/SyncML.java +++ /dev/null @@ -1,192 +0,0 @@ -package org.kxml2.wap.syncml; - -import org.kxml2.wap.*; - -public abstract class SyncML { - - - // SyncML-Common (-//SYNCML//DTD SyncML 1.2//EN and -//SYNCML//DTD MetInf 1.2//EN) support - - public static WbxmlParser createParser() { - WbxmlParser p = new WbxmlParser(); - p.setTagTable(0, TAG_TABLE_0); - p.setTagTable(1, TAG_TABLE_1); - return p; - } - - public static WbxmlSerializer createSerializer() { - WbxmlSerializer s = new WbxmlSerializer(); - s.setTagTable(0, TAG_TABLE_0); - s.setTagTable(1, TAG_TABLE_1); - return s; - } - - - // SyncML-Common + DMDDF (-//OMA//DTD-DM-DDF 1.2//EN) support - - public static WbxmlParser createDMParser() { - WbxmlParser p = createParser(); - p.setTagTable(2, TAG_TABLE_2_DM); - return p; - } - - public static WbxmlSerializer createDMSerializer() { - WbxmlSerializer s = createSerializer(); - s.setTagTable(2, TAG_TABLE_2_DM); - return s; - } - - // Tables - - public static final String [] TAG_TABLE_0 = { - - // -//SYNCML//DTD SyncML 1.2//EN - - "Add", // 0x05 - "Alert", // 0x06 - "Archive", // 0x07 - "Atomic", // 0x08 - "Chal", // 0x09 - "Cmd", // 0x0a - "CmdID", // 0x0b - "CmdRef", // 0x0c - "Copy", // 0x0d - "Cred", // 0x0e - "Data", // 0x0f - "Delete", // 0x10 - "Exec", // 0x11 - "Final", // 0x12 - "Get", // 0x13 - "Item", // 0x14 - "Lang", // 0x15 - "LocName", // 0x16 - "LocURI", // 0x17 - "Map", // 0x18 - "MapItem", // 0x19 - "Meta", // 0x1a - "MsgID", // 0x1b - "MsgRef", // 0x1c - "NoResp", // 0x1d - "NoResults", // 0x1e - "Put", // 0x1f - "Replace", // 0x20 - "RespURI", // 0x21 - "Results", // 0x22 - "Search", // 0x23 - "Sequence", // 0x24 - "SessionID", // 0x25 - "SftDel", // 0x26 - "Source", // 0x27 - "SourceRef", // 0x28 - "Status", // 0x29 - "Sync", // 0x2a - "SyncBody", // 0x2b - "SyncHdr", // 0x2c - "SyncML", // 0x2d - "Target", // 0x2e - "TargetRef", // 0x2f - "Reserved for future use", // 0x30 - "VerDTD", // 0x31 - "VerProto", // 0x32 - "NumberOfChanged",// 0x33 - "MoreData", // 0x34 - "Field", // 0x35 - "Filter", // 0x36 - "Record", // 0x37 - "FilterType", // 0x38 - "SourceParent", // 0x39 - "TargetParent", // 0x3a - "Move", // 0x3b - "Correlator" // 0x3c - }; - - public static final String [] TAG_TABLE_1 = { - - // -//SYNCML//DTD MetInf 1.2//EN - - "Anchor", // 0x05 - "EMI", // 0x06 - "Format", // 0x07 - "FreeID", // 0x08 - "FreeMem", // 0x09 - "Last", // 0x0a - "Mark", // 0x0b - "MaxMsgSize", // 0x0c - "Mem", // 0x0d - "MetInf", // 0x0e - "Next", // 0x0f - "NextNonce", // 0x10 - "SharedMem", // 0x11 - "Size", // 0x12 - "Type", // 0x13 - "Version", // 0x14 - "MaxObjSize", // 0x15 - "FieldLevel" // 0x16 - - }; - - public static final String [] TAG_TABLE_2_DM = { - - // -//OMA//DTD-DM-DDF 1.2//EN - - "AccessType", // 0x05 - "ACL", // 0x06 - "Add", // 0x07 - "b64", // 0x08 - "bin", // 0x09 - "bool", // 0x0a - "chr", // 0x0b - "CaseSense", // 0x0c - "CIS", // 0x0d - "Copy", // 0x0e - "CS", // 0x0f - "date", // 0x10 - "DDFName", // 0x11 - "DefaultValue", // 0x12 - "Delete", // 0x13 - "Description", // 0x14 - "DDFFormat", // 0x15 - "DFProperties", // 0x16 - "DFTitle", // 0x17 - "DFType", // 0x18 - "Dynamic", // 0x19 - "Exec", // 0x1a - "float", // 0x1b - "Format", // 0x1c - "Get", // 0x1d - "int", // 0x1e - "Man", // 0x1f - "MgmtTree", // 0x20 - "MIME", // 0x21 - "Mod", // 0x22 - "Name", // 0x23 - "Node", // 0x24 - "node", // 0x25 - "NodeName", // 0x26 - "null", // 0x27 - "Occurence", // 0x28 - "One", // 0x29 - "OneOrMore", // 0x2a - "OneOrN", // 0x2b - "Path", // 0x2c - "Permanent", // 0x2d - "Replace", // 0x2e - "RTProperties", // 0x2f - "Scope", // 0x30 - "Size", // 0x31 - "time", // 0x32 - "Title", // 0x33 - "TStamp", // 0x34 - "Type", // 0x35 - "Value", // 0x36 - "VerDTD", // 0x37 - "VerNo", // 0x38 - "xml", // 0x39 - "ZeroOrMore", // 0x3a - "ZeroOrN", // 0x3b - "ZeroOrOne" // 0x3c - - }; - -} - diff --git a/xml/src/main/java/org/kxml2/wap/wml/Wml.java b/xml/src/main/java/org/kxml2/wap/wml/Wml.java deleted file mode 100644 index 7e925d8..0000000 --- a/xml/src/main/java/org/kxml2/wap/wml/Wml.java +++ /dev/null @@ -1,233 +0,0 @@ -package org.kxml2.wap.wml; - -import org.kxml2.wap.*; - - -/** This class contains the wml coding tables for elements - * and attributes needed by the WmlParser. - */ - - -public abstract class Wml { - - /** Creates a WbxmlParser with the WML code pages set */ - - public static WbxmlParser createParser() { - WbxmlParser p = new WbxmlParser(); - p.setTagTable(0, TAG_TABLE); - p.setAttrStartTable(0, ATTR_START_TABLE); - p.setAttrValueTable(0, ATTR_VALUE_TABLE); - return p; - } - - public static WbxmlSerializer createSerializer() { - WbxmlSerializer s = new WbxmlSerializer(); - s.setTagTable(0, TAG_TABLE); - s.setAttrStartTable(0, ATTR_START_TABLE); - s.setAttrValueTable(0, ATTR_VALUE_TABLE); - return s; - } - - - public static final String [] TAG_TABLE = { - - null, // 05 - null, // 06 - null, // 07 - null, // 08 - null, // 09 - null, // 0A - null, // 0B - null, // 0C - null, // 0D - null, // 0E - null, // 0F - - null, // 10 - null, // 11 - null, // 12 - null, // 13 - null, // 14 - null, // 15 - null, // 16 - null, // 17 - null, // 18 - null, // 19 - null, // 1A - null, // 1B - "a", // 1C - "td", // 1D - "tr", // 1E - "table", // 1F - - "p", // 20 - "postfield", // 21 - "anchor", // 22 - "access", // 23 - "b", // 24 - "big", // 25 - "br", // 26 - "card", // 27 - "do", // 28 - "em", // 29 - "fieldset", // 2A - "go", // 2B - "head", // 2C - "i", // 2D - "img", // 2E - "input", // 2F - - "meta", // 30 - "noop", // 31 - "prev", // 32 - "onevent", // 33 - "optgroup", // 34 - "option", // 35 - "refresh", // 36 - "select", // 37 - "small", // 38 - "strong", // 39 - null, // 3A - "template", // 3B - "timer", // 3C - "u", // 3D - "setvar", // 3E - "wml", // 3F - }; - - - public static final String [] ATTR_START_TABLE = { - "accept-charset", // 05 - "align=bottom", // 06 - "align=center", // 07 - "align=left", // 08 - "align=middle", // 09 - "align=right", // 0A - "align=top", // 0B - "alt", // 0C - "content", // 0D - null, // 0E - "domain", // 0F - - "emptyok=false", // 10 - "emptyok=true", // 11 - "format", // 12 - "height", // 13 - "hspace", // 14 - "ivalue", // 15 - "iname", // 16 - null, // 17 - "label", // 18 - "localsrc", // 19 - "maxlength", // 1A - "method=get", // 1B - "method=post", // 1C - "mode=nowrap", // 1D - "mode=wrap", // 1E - "multiple=false", // 1F - - "multiple=true", // 20 - "name", // 21 - "newcontext=false", // 22 - "newcontext=true", // 23 - "onpick", // 24 - "onenterbackward", // 25 - "onenterforward", // 26 - "ontimer", // 27 - "optimal=false", // 28 - "optimal=true", // 29 - "path", // 2A - null, // 2B - null, // 2C - null, // 2D - "scheme", // 2E - "sendreferer=false", // 2F - - "sendreferer=true", // 30 - "size", // 31 - "src", // 32 - "ordered=true", // 33 - "ordered=false", // 34 - "tabindex", // 35 - "title", // 36 - "type", // 37 - "type=accept", // 38 - "type=delete", // 39 - "type=help", // 3A - "type=password", // 3B - "type=onpick", // 3C - "type=onenterbackward", // 3D - "type=onenterforward", // 3E - "type=ontimer", // 3F - - null, // 40 - null, // 41 - null, // 42 - null, // 43 - null, // 44 - "type=options", // 45 - "type=prev", // 46 - "type=reset", // 47 - "type=text", // 48 - "type=vnd.", // 49 - "href", // 4A - "href=http://", // 4B - "href=https://", // 4C - "value", // 4D - "vspace", // 4E - "width", // 4F - - "xml:lang", // 50 - null, // 51 - "align", // 52 - "columns", // 53 - "class", // 54 - "id", // 55 - "forua=false", // 56 - "forua=true", // 57 - "src=http://", // 58 - "src=https://", // 59 - "http-equiv", // 5A - "http-equiv=Content-Type", // 5B - "content=application/vnd.wap.wmlc;charset=", // 5C - "http-equiv=Expires", // 5D - null, // 5E - null, // 5F - }; - - - public static final String [] ATTR_VALUE_TABLE = { - ".com/", // 85 - ".edu/", // 86 - ".net/", // 87 - ".org/", // 88 - "accept", // 89 - "bottom", // 8A - "clear", // 8B - "delete", // 8C - "help", // 8D - "http://", // 8E - "http://www.", // 8F - - "https://", // 90 - "https://www.", // 91 - null, // 92 - "middle", // 93 - "nowrap", // 94 - "onpick", // 95 - "onenterbackward", // 96 - "onenterforward", // 97 - "ontimer", // 98 - "options", // 99 - "password", // 9A - "reset", // 9B - null, // 9C - "text", // 9D - "top", // 9E - "unknown", // 9F - - "wrap", // A0 - "www.", // A1 - }; -} - diff --git a/xml/src/main/java/org/kxml2/wap/wv/WV.java b/xml/src/main/java/org/kxml2/wap/wv/WV.java deleted file mode 100644 index e2afbfb..0000000 --- a/xml/src/main/java/org/kxml2/wap/wv/WV.java +++ /dev/null @@ -1,593 +0,0 @@ -package org.kxml2.wap.wv; - -import java.io.IOException; - -import org.kxml2.wap.*; - -/* - - * WV.java - - * - - * Created on 25 September 2003, 10:40 - - */ - - - - - - /** - * Wireless Village CSP 1.1 ("OMA-WV-CSP-V1_1-20021001-A.pdf") - * Wireless Village CSP 1.2 ("OMA-IMPS-WV-CSP_WBXML-v1_2-20030221-C.PDF") - * There are some bugs in the 1.2 spec but this is Ok. 1.2 is candidate - * - - * @author Bogdan Onoiu - - */ - -public abstract class WV { - - - - - - public static WbxmlParser createParser () throws IOException { - - WbxmlParser parser = new WbxmlParser(); - - parser.setTagTable (0, WV.tagTablePage0); - parser.setTagTable (1, WV.tagTablePage1); - parser.setTagTable (2, WV.tagTablePage2); - parser.setTagTable (3, WV.tagTablePage3); - parser.setTagTable (4, WV.tagTablePage4); - parser.setTagTable (5, WV.tagTablePage5); - parser.setTagTable (6, WV.tagTablePage6); - parser.setTagTable (7, WV.tagTablePage7); - parser.setTagTable (8, WV.tagTablePage8); - parser.setTagTable (9, WV.tagTablePage9); - parser.setTagTable (10, WV.tagTablePageA); - - parser.setAttrStartTable (0, WV.attrStartTable); - - parser.setAttrValueTable (0, WV.attrValueTable); - - return parser; - } - - - - public static final String [] tagTablePage0 = { - /* Common ... continue on Page 0x09 */ - "Acceptance", //0x00, 0x05 - "AddList", //0x00, 0x06 - "AddNickList", //0x00, 0x07 - "SName", //0x00, 0x08 - "WV-CSP-Message", //0x00, 0x09 - "ClientID", //0x00, 0x0A - "Code", //0x00, 0x0B - "ContactList", //0x00, 0x0C - "ContentData", //0x00, 0x0D - "ContentEncoding",//0x00, 0x0E - "ContentSize", //0x00, 0x0F - "ContentType", //0x00, 0x10 - "DateTime", //0x00, 0x11 - "Description", //0x00, 0x12 - "DetailedResult", //0x00, 0x13 - "EntityList", //0x00, 0x14 - "Group", //0x00, 0x15 - "GroupID", //0x00, 0x16 - "GroupList", //0x00, 0x17 - "InUse", //0x00, 0x18 - "Logo", //0x00, 0x19 - "MessageCount", //0x00, 0x1A - "MessageID", //0x00, 0x1B - "MessageURI", //0x00, 0x1C - "MSISDN", //0x00, 0x1D - "Name", //0x00, 0x1E - "NickList", //0x00, 0x1F - "NickName", //0x00, 0x20 - "Poll", //0x00, 0x21 - "Presence", //0x00, 0x22 - "PresenceSubList",//0x00, 0x23 - "PresenceValue", //0x00, 0x24 - "Property", //0x00, 0x25 - "Qualifier", //0x00, 0x26 - "Recipient", //0x00, 0x27 - "RemoveList", //0x00, 0x28 - "RemoveNickList", //0x00, 0x29 - "Result", //0x00, 0x2A - "ScreenName", //0x00, 0x2B - "Sender", //0x00, 0x2C - "Session", //0x00, 0x2D - "SessionDescriptor",//0x00, 0x2E - "SessionID", //0x00, 0x2F - "SessionType", //0x00, 0x30 - "Status", //0x00, 0x31 - "Transaction", //0x00, 0x32 - "TransactionContent",//0x00, 0x33 - "TransactionDescriptor",//0x00, 0x34 - "TransactionID", //0x00, 0x35 - "TransactionMode",//0x00, 0x36 - "URL", //0x00, 0x37 - "URLList", //0x00, 0x38 - "User", //0x00, 0x39 - "UserID", //0x00, 0x3A - "UserList", //0x00, 0x3B - "Validity", //0x00, 0x3C - "Value", //0x00, 0x3D - }; - - public static final String [] tagTablePage1 = { - /* Access ... continue on Page 0x0A */ - "AllFunctions", // 0x01, 0x05 - "AllFunctionsRequest", // 0x01, 0x06 - "CancelInvite-Request", // 0x01, 0x07 - "CancelInviteUser-Request", // 0x01, 0x08 - "Capability", // 0x01, 0x09 - "CapabilityList", // 0x01, 0x0A - "CapabilityRequest", // 0x01, 0x0B - "ClientCapability-Request", // 0x01, 0x0C - "ClientCapability-Response",// 0x01, 0x0D - "DigestBytes", // 0x01, 0x0E - "DigestSchema", // 0x01, 0x0F - "Disconnect", // 0x01, 0x10 - "Functions", // 0x01, 0x11 - "GetSPInfo-Request", // 0x01, 0x12 - "GetSPInfo-Response", // 0x01, 0x13 - "InviteID", // 0x01, 0x14 - "InviteNote", // 0x01, 0x15 - "Invite-Request", // 0x01, 0x16 - "Invite-Response", // 0x01, 0x17 - "InviteType", // 0x01, 0x18 - "InviteUser-Request", // 0x01, 0x19 - "InviteUser-Response", // 0x01, 0x1A - "KeepAlive-Request", // 0x01, 0x1B - "KeepAliveTime", // 0x01, 0x1C - "Login-Request", // 0x01, 0x1D - "Login-Response", // 0x01, 0x1E - "Logout-Request", // 0x01, 0x1F - "Nonce", // 0x01, 0x20 - "Password", // 0x01, 0x21 - "Polling-Request", // 0x01, 0x22 - "ResponseNote", // 0x01, 0x23 - "SearchElement", // 0x01, 0x24 - "SearchFindings", // 0x01, 0x25 - "SearchID", // 0x01, 0x26 - "SearchIndex", // 0x01, 0x27 - "SearchLimit", // 0x01, 0x28 - "KeepAlive-Response", // 0x01, 0x29 - "SearchPairList", // 0x01, 0x2A - "Search-Request", // 0x01, 0x2B - "Search-Response", // 0x01, 0x2C - "SearchResult", // 0x01, 0x2D - "Service-Request", // 0x01, 0x2E - "Service-Response", // 0x01, 0x2F - "SessionCookie", // 0x01, 0x30 - "StopSearch-Request", // 0x01, 0x31 - "TimeToLive", // 0x01, 0x32 - "SearchString", // 0x01, 0x33 - "CompletionFlag", // 0x01, 0x34 - null, // 0x01, 0x35 - "ReceiveList", // 0x01, 0x36 /* WV 1.2 */ - "VerifyID-Request", // 0x01, 0x37 /* WV 1.2 */ - "Extended-Request", // 0x01, 0x38 /* WV 1.2 */ - "Extended-Response", // 0x01, 0x39 /* WV 1.2 */ - "AgreedCapabilityList", // 0x01, 0x3A /* WV 1.2 */ - "Extended-Data", // 0x01, 0x3B /* WV 1.2 */ - "OtherServer", // 0x01, 0x3C /* WV 1.2 */ - "PresenceAttributeNSName",//0x01, 0x3D /* WV 1.2 */ - "SessionNSName", // 0x01, 0x3E /* WV 1.2 */ - "TransactionNSName", // 0x01, 0x3F /* WV 1.2 */ - }; - - public static final String [] tagTablePage2 = { - /* Service ... continue on Page 0x08 */ - "ADDGM", // 0x02, 0x05 - "AttListFunc", // 0x02, 0x06 - "BLENT", // 0x02, 0x07 - "CAAUT", // 0x02, 0x08 - "CAINV", // 0x02, 0x09 - "CALI", // 0x02, 0x0A - "CCLI", // 0x02, 0x0B - "ContListFunc", // 0x02, 0x0C - "CREAG", // 0x02, 0x0D - "DALI", // 0x02, 0x0E - "DCLI", // 0x02, 0x0F - "DELGR", // 0x02, 0x10 - "FundamentalFeat",//0x02, 0x11 - "FWMSG", // 0x02, 0x12 - "GALS", // 0x02, 0x13 - "GCLI", // 0x02, 0x14 - "GETGM", // 0x02, 0x15 - "GETGP", // 0x02, 0x16 - "GETLM", // 0x02, 0x17 - "GETM", // 0x02, 0x18 - "GETPR", // 0x02, 0x19 - "GETSPI", // 0x02, 0x1A - "GETWL", // 0x02, 0x1B - "GLBLU", // 0x02, 0x1C - "GRCHN", // 0x02, 0x1D - "GroupAuthFunc",// 0x02, 0x1E - "GroupFeat", // 0x02, 0x1F - "GroupMgmtFunc",// 0x02, 0x20 - "GroupUseFunc", // 0x02, 0x21 - "IMAuthFunc", // 0x02, 0x22 - "IMFeat", // 0x02, 0x23 - "IMReceiveFunc",// 0x02, 0x24 - "IMSendFunc", // 0x02, 0x25 - "INVIT", // 0x02, 0x26 - "InviteFunc", // 0x02, 0x27 - "MBRAC", // 0x02, 0x28 - "MCLS", // 0x02, 0x29 - "MDELIV", // 0x02, 0x2A - "NEWM", // 0x02, 0x2B - "NOTIF", // 0x02, 0x2C - "PresenceAuthFunc",//0x02, 0x2D - "PresenceDeliverFunc",//0x02, 0x2E - "PresenceFeat", // 0x02, 0x2F - "REACT", // 0x02, 0x30 - "REJCM", // 0x02, 0x31 - "REJEC", // 0x02, 0x32 - "RMVGM", // 0x02, 0x33 - "SearchFunc", // 0x02, 0x34 - "ServiceFunc", // 0x02, 0x35 - "SETD", // 0x02, 0x36 - "SETGP", // 0x02, 0x37 - "SRCH", // 0x02, 0x38 - "STSRC", // 0x02, 0x39 - "SUBGCN", // 0x02, 0x3A - "UPDPR", // 0x02, 0x3B - "WVCSPFeat", // 0x02, 0x3C - "MF", // 0x02, 0x3D /* WV 1.2 */ - "MG", // 0x02, 0x3E /* WV 1.2 */ - "MM" // 0x02, 0x3F /* WV 1.2 */ - }; - - public static final String [] tagTablePage3 = { - /* Client Capability */ - "AcceptedCharset", // 0x03, 0x05 - "AcceptedContentLength", // 0x03, 0x06 - "AcceptedContentType", // 0x03, 0x07 - "AcceptedTransferEncoding", // 0x03, 0x08 - "AnyContent", // 0x03, 0x09 - "DefaultLanguage", // 0x03, 0x0A - "InitialDeliveryMethod", // 0x03, 0x0B - "MultiTrans", // 0x03, 0x0C - "ParserSize", // 0x03, 0x0D - "ServerPollMin", // 0x03, 0x0E - "SupportedBearer", // 0x03, 0x0F - "SupportedCIRMethod", // 0x03, 0x10 - "TCPAddress", // 0x03, 0x11 - "TCPPort", // 0x03, 0x12 - "UDPPort" // 0x03, 0x13 - }; - - public static final String [] tagTablePage4 = { - /* Presence Primitive */ - "CancelAuth-Request", // 0x04, 0x05 - "ContactListProperties", // 0x04, 0x06 - "CreateAttributeList-Request", // 0x04, 0x07 - "CreateList-Request", // 0x04, 0x08 - "DefaultAttributeList", // 0x04, 0x09 - "DefaultContactList", // 0x04, 0x0A - "DefaultList", // 0x04, 0x0B - "DeleteAttributeList-Request", // 0x04, 0x0C - "DeleteList-Request", // 0x04, 0x0D - "GetAttributeList-Request", // 0x04, 0x0E - "GetAttributeList-Response", // 0x04, 0x0F - "GetList-Request", // 0x04, 0x10 - "GetList-Response", // 0x04, 0x11 - "GetPresence-Request", // 0x04, 0x12 - "GetPresence-Response", // 0x04, 0x13 - "GetWatcherList-Request", // 0x04, 0x14 - "GetWatcherList-Response", // 0x04, 0x15 - "ListManage-Request", // 0x04, 0x16 - "ListManage-Response", // 0x04, 0x17 - "UnsubscribePresence-Request", // 0x04, 0x18 - "PresenceAuth-Request", // 0x04, 0x19 - "PresenceAuth-User", // 0x04, 0x1A - "PresenceNotification-Request", // 0x04, 0x1B - "UpdatePresence-Request", // 0x04, 0x1C - "SubscribePresence-Request", // 0x04, 0x1D - "Auto-Subscribe", // 0x04, 0x1E /* WV 1.2 */ - "GetReactiveAuthStatus-Request",// 0x04, 0x1F /* WV 1.2 */ - "GetReactiveAuthStatus-Response",// 0x04, 0x20 /* WV 1.2 */ - }; - - public static final String [] tagTablePage5 = { - /* Presence Attribute */ - "Accuracy", // 0x05, 0x05 - "Address", // 0x05, 0x06 - "AddrPref", // 0x05, 0x07 - "Alias", // 0x05, 0x08 - "Altitude", // 0x05, 0x09 - "Building", // 0x05, 0x0A - "Caddr", // 0x05, 0x0B - "City", // 0x05, 0x0C - "ClientInfo", // 0x05, 0x0D - "ClientProducer", // 0x05, 0x0E - "ClientType", // 0x05, 0x0F - "ClientVersion", // 0x05, 0x10 - "CommC", // 0x05, 0x11 - "CommCap", // 0x05, 0x12 - "ContactInfo", // 0x05, 0x13 - "ContainedvCard", // 0x05, 0x14 - "Country", // 0x05, 0x15 - "Crossing1", // 0x05, 0x16 - "Crossing2", // 0x05, 0x17 - "DevManufacturer", // 0x05, 0x18 - "DirectContent", // 0x05, 0x19 - "FreeTextLocation", // 0x05, 0x1A - "GeoLocation", // 0x05, 0x1B - "Language", // 0x05, 0x1C - "Latitude", // 0x05, 0x1D - "Longitude", // 0x05, 0x1E - "Model", // 0x05, 0x1F - "NamedArea", // 0x05, 0x20 - "OnlineStatus", // 0x05, 0x21 - "PLMN", // 0x05, 0x22 - "PrefC", // 0x05, 0x23 - "PreferredContacts",// 0x05, 0x24 - "PreferredLanguage",// 0x05, 0x25 - "PreferredContent", // 0x05, 0x26 - "PreferredvCard", // 0x05, 0x27 - "Registration", // 0x05, 0x28 - "StatusContent", // 0x05, 0x29 - "StatusMood", // 0x05, 0x2A - "StatusText", // 0x05, 0x2B - "Street", // 0x05, 0x2C - "TimeZone", // 0x05, 0x2D - "UserAvailability", // 0x05, 0x2E - "Cap", // 0x05, 0x2F - "Cname", // 0x05, 0x30 - "Contact", // 0x05, 0x31 - "Cpriority", // 0x05, 0x32 - "Cstatus", // 0x05, 0x33 - "Note", // 0x05, 0x34 /* WV 1.2 */ - "Zone", // 0x05, 0x35 - null, - "Inf_link", // 0x05, 0x37 /* WV 1.2 */ - "InfoLink", // 0x05, 0x38 /* WV 1.2 */ - "Link", // 0x05, 0x39 /* WV 1.2 */ - "Text", // 0x05, 0x3A /* WV 1.2 */ - }; - - public static final String [] tagTablePage6 = { - /* Messaging */ - "BlockList", // 0x06, 0x05 -// "BlockUser-Request", // 0x06, 0x06 //This is a bug in the spec - "BlockEntity-Request", // 0x06, 0x06 - "DeliveryMethod", // 0x06, 0x07 - "DeliveryReport", // 0x06, 0x08 - "DeliveryReport-Request", // 0x06, 0x09 - "ForwardMessage-Request", // 0x06, 0x0A - "GetBlockedList-Request", // 0x06, 0x0B - "GetBlockedList-Response", // 0x06, 0x0C - "GetMessageList-Request", // 0x06, 0x0D - "GetMessageList-Response", // 0x06, 0x0E - "GetMessage-Request", // 0x06, 0x0F - "GetMessage-Response", // 0x06, 0x10 - "GrantList", // 0x06, 0x11 - "MessageDelivered", // 0x06, 0x12 - "MessageInfo", // 0x06, 0x13 - "MessageNotification", // 0x06, 0x14 - "NewMessage", // 0x06, 0x15 - "RejectMessage-Request", // 0x06, 0x16 - "SendMessage-Request", // 0x06, 0x17 - "SendMessage-Response", // 0x06, 0x18 - "SetDeliveryMethod-Request",// 0x06, 0x19 - "DeliveryTime", // 0x06, 0x1A - }; - - public static final String [] tagTablePage7 = { - /* Group */ - "AddGroupMembers-Request", // 0x07, 0x05 - "Admin", // 0x07, 0x06 - "CreateGroup-Request", // 0x07, 0x07 - "DeleteGroup-Request", // 0x07, 0x08 - "GetGroupMembers-Request", // 0x07, 0x09 - "GetGroupMembers-Response", // 0x07, 0x0A - "GetGroupProps-Request", // 0x07, 0x0B - "GetGroupProps-Response", // 0x07, 0x0C - "GroupChangeNotice", // 0x07, 0x0D - "GroupProperties", // 0x07, 0x0E - "Joined", // 0x07, 0x0F - "JoinedRequest", // 0x07, 0x10 - "JoinGroup-Request", // 0x07, 0x11 - "JoinGroup-Response", // 0x07, 0x12 - "LeaveGroup-Request", // 0x07, 0x13 - "LeaveGroup-Response", // 0x07, 0x14 - "Left", // 0x07, 0x15 - "MemberAccess-Request", // 0x07, 0x16 - "Mod", // 0x07, 0x17 - "OwnProperties", // 0x07, 0x18 - "RejectList-Request", // 0x07, 0x19 - "RejectList-Response", // 0x07, 0x1A - "RemoveGroupMembers-Request",// 0x07, 0x1B - "SetGroupProps-Request", // 0x07, 0x1C - "SubscribeGroupNotice-Request", // 0x07, 0x1D - "SubscribeGroupNotice-Response",// 0x07, 0x1E - "Users", // 0x07, 0x1F - "WelcomeNote", // 0x07, 0x20 - "JoinGroup", // 0x07, 0x21 - "SubscribeNotification", // 0x07, 0x22 - "SubscribeType", // 0x07, 0x23 - "GetJoinedUsers-Request", // 0x07, 0x24 /* WV 1.2 */ - "GetJoinedUsers-Response", // 0x07, 0x25 /* WV 1.2 */ - "AdminMapList", // 0x07, 0x26 /* WV 1.2 */ - "AdminMapping", // 0x07, 0x27 /* WV 1.2 */ - "Mapping", // 0x07, 0x28 /* WV 1.2 */ - "ModMapping", // 0x07, 0x29 /* WV 1.2 */ - "UserMapList", // 0x07, 0x2A /* WV 1.2 */ - "UserMapping", // 0x07, 0x2B /* WV 1.2 */ - }; - - public static final String [] tagTablePage8 = { - /* Service ... continued */ - "MP", // 0x08, 0x05 /* WV 1.2 */ - "GETAUT", // 0x08, 0x06 /* WV 1.2 */ - "GETJU", // 0x08, 0x07 /* WV 1.2 */ - "VRID", // 0x08, 0x08 /* WV 1.2 */ - "VerifyIDFunc", // 0x08, 0x09 /* WV 1.2 */ - }; - - public static final String [] tagTablePage9 = { - /* Common ... continued */ - "CIR", // 0x09, 0x05 /* WV 1.2 */ - "Domain", // 0x09, 0x06 /* WV 1.2 */ - "ExtBlock", // 0x09, 0x07 /* WV 1.2 */ - "HistoryPeriod", // 0x09, 0x08 /* WV 1.2 */ - "IDList", // 0x09, 0x09 /* WV 1.2 */ - "MaxWatcherList", // 0x09, 0x0A /* WV 1.2 */ - "ReactiveAuthState", // 0x09, 0x0B /* WV 1.2 */ - "ReactiveAuthStatus", // 0x09, 0x0C /* WV 1.2 */ - "ReactiveAuthStatusList", // 0x09, 0x0D /* WV 1.2 */ - "Watcher", // 0x09, 0x0E /* WV 1.2 */ - "WatcherStatus" // 0x09, 0x0F /* WV 1.2 */ - }; - - public static final String [] tagTablePageA = { - /* Access ... continued */ - "WV-CSP-NSDiscovery-Request", //0x0A, 0x05 /* WV 1.2 */ - "WV-CSP-NSDiscovery-Response", //0x0A, 0x06 /* WV 1.2 */ - "VersionList" //0x0A, 0x07 /* WV 1.2 */ - }; - - public static final String [] attrStartTable = { - "xmlns=http://www.wireless-village.org/CSP",// 0x00, 0x05 - "xmlns=http://www.wireless-village.org/PA", // 0x00, 0x06 - "xmlns=http://www.wireless-village.org/TRC",// 0x00, 0x07 - "xmlns=http://www.openmobilealliance.org/DTD/WV-CSP", // 0x00, 0x08 - "xmlns=http://www.openmobilealliance.org/DTD/WV-PA", // 0x00, 0x09 - "xmlns=http://www.openmobilealliance.org/DTD/WV-TRC", // 0x00, 0x0A - }; - - public static final String [] attrValueTable = { - - "AccessType", // 0x00 /* Common value token */ - "ActiveUsers", // 0x01 /* Common value token */ - "Admin", // 0x02 /* Common value token */ - "application/", // 0x03 /* Common value token */ - "application/vnd.wap.mms-message", // 0x04 /* Common value token */ - "application/x-sms", // 0x05 /* Common value token */ - "AutoJoin", // 0x06 /* Common value token */ - "BASE64", // 0x07 /* Common value token */ - "Closed", // 0x08 /* Common value token */ - "Default", // 0x09 /* Common value token */ - "DisplayName", // 0x0a /* Common value token */ - "F", // 0x0b /* Common value token */ - "G", // 0x0c /* Common value token */ - "GR", // 0x0d /* Common value token */ - "http://", // 0x0e /* Common value token */ - "https://", // 0x0f /* Common value token */ - "image/", // 0x10 /* Common value token */ - "Inband", // 0x11 /* Common value token */ - "IM", // 0x12 /* Common value token */ - "MaxActiveUsers", // 0x13 /* Common value token */ - "Mod", // 0x14 /* Common value token */ - "Name", // 0x15 /* Common value token */ - "None", // 0x16 /* Common value token */ - "N", // 0x17 /* Common value token */ - "Open", // 0x18 /* Common value token */ - "Outband", // 0x19 /* Common value token */ - "PR", // 0x1a /* Common value token */ - "Private", // 0x1b /* Common value token */ - "PrivateMessaging", // 0x1c /* Common value token */ - "PrivilegeLevel", // 0x1d /* Common value token */ - "Public", // 0x1e /* Common value token */ - "P", // 0x1f /* Common value token */ - "Request", // 0x20 /* Common value token */ - "Response", // 0x21 /* Common value token */ - "Restricted", // 0x22 /* Common value token */ - "ScreenName", // 0x23 /* Common value token */ - "Searchable", // 0x24 /* Common value token */ - "S", // 0x25 /* Common value token */ - "SC", // 0x26 /* Common value token */ - "text/", // 0x27 /* Common value token */ - "text/plain", // 0x28 /* Common value token */ - "text/x-vCalendar", // 0x29 /* Common value token */ - "text/x-vCard", // 0x2a /* Common value token */ - "Topic", // 0x2b /* Common value token */ - "T", // 0x2c /* Common value token */ - "Type", // 0x2d /* Common value token */ - "U", // 0x2e /* Common value token */ - "US", // 0x2f /* Common value token */ - "www.wireless-village.org", // 0x30 /* Common value token */ - "AutoDelete", // 0x31 /* Common value token */ /* WV 1.2 */ - "GM", // 0x32 /* Common value token */ /* WV 1.2 */ - "Validity", // 0x33 /* Common value token */ /* WV 1.2 */ - "ShowID", // 0x34 /* Common value token */ /* WV 1.2 */ - "GRANTED", // 0x35 /* Common value token */ /* WV 1.2 */ - "PENDING", // 0x36 /* Common value token */ /* WV 1.2 */ - null, // 0x37 - null, // 0x38 - null, // 0x39 - null, // 0x3a - null, // 0x3b - null, // 0x3c - "GROUP_ID", // 0x3d /* Access value token */ - "GROUP_NAME", // 0x3e /* Access value token */ - "GROUP_TOPIC", // 0x3f /* Access value token */ - "GROUP_USER_ID_JOINED", // 0x40 /* Access value token */ - "GROUP_USER_ID_OWNER", // 0x41 /* Access value token */ - "HTTP", // 0x42 /* Access value token */ - "SMS", // 0x43 /* Access value token */ - "STCP", // 0x44 /* Access value token */ - "SUDP", // 0x45 /* Access value token */ - "USER_ALIAS", // 0x46 /* Access value token */ - "USER_EMAIL_ADDRESS", // 0x47 /* Access value token */ - "USER_FIRST_NAME", // 0x48 /* Access value token */ - "USER_ID", // 0x49 /* Access value token */ - "USER_LAST_NAME", // 0x4a /* Access value token */ - "USER_MOBILE_NUMBER", // 0x4b /* Access value token */ - "USER_ONLINE_STATUS", // 0x4c /* Access value token */ - "WAPSMS", // 0x4d /* Access value token */ - "WAPUDP", // 0x4e /* Access value token */ - "WSP", // 0x4f /* Access value token */ - "GROUP_USER_ID_AUTOJOIN", // 0x50 /* Access value token */ /* WV 1.2 */ - null, // 0x51 - null, // 0x52 - null, // 0x53 - null, // 0x54 - null, // 0x55 - null, // 0x56 - null, // 0x57 - null, // 0x58 - null, // 0x59 - null, // 0x5a - "ANGRY", // 0x5b /* Presence value token */ - "ANXIOUS", // 0x5c /* Presence value token */ - "ASHAMED", // 0x5d /* Presence value token */ - "AUDIO_CALL", // 0x5e /* Presence value token */ - "AVAILABLE", // 0x5f /* Presence value token */ - "BORED", // 0x60 /* Presence value token */ - "CALL", // 0x61 /* Presence value token */ - "CLI", // 0x62 /* Presence value token */ - "COMPUTER", // 0x63 /* Presence value token */ - "DISCREET", // 0x64 /* Presence value token */ - "EMAIL", // 0x65 /* Presence value token */ - "EXCITED", // 0x66 /* Presence value token */ - "HAPPY", // 0x67 /* Presence value token */ - "IM", // 0x68 /* Presence value token */ - "IM_OFFLINE", // 0x69 /* Presence value token */ - "IM_ONLINE", // 0x6a /* Presence value token */ - "IN_LOVE", // 0x6b /* Presence value token */ - "INVINCIBLE", // 0x6c /* Presence value token */ - "JEALOUS", // 0x6d /* Presence value token */ - "MMS", // 0x6e /* Presence value token */ - "MOBILE_PHONE", // 0x6f /* Presence value token */ - "NOT_AVAILABLE", // 0x70 /* Presence value token */ - "OTHER", // 0x71 /* Presence value token */ - "PDA", // 0x72 /* Presence value token */ - "SAD", // 0x73 /* Presence value token */ - "SLEEPY", // 0x74 /* Presence value token */ - "SMS", // 0x75 /* Presence value token */ - "VIDEO_CALL", // 0x76 /* Presence value token */ - "VIDEO_STREAM", // 0x77 /* Presence value token */ - }; - - -} |