??? es.rickyepoderi.wbxml.document

This package is a Java/Object/Memory representation of a WBXML document.

???: ??

  • ???? 
    WBXML defines that attribute and content can have a special kind of opaque data (an array of bytes in length).
    WBXML defines that attribute and content can have a special kind of opaque data (an array of bytes in length).
  • ??? 
    Java representation for an attribute in the WBXML specification.
    Java representation of the body of the WBXML format.
    Java representation of the content of an element in the WBXML format.
    Java representation of a whole WBXML document.
    Java representation of an WBXML element.
    The encoder class is the object to encode a Java WbXmlDocument object into a real WBXML stream.
    WBXML specification defines in the chapter 7.1.
    The parser is the class that is used to parse an WBXML document into a WbXmlDocument object in this package.
    WBXML defines a string table that can be used in any parsing or encoding process.
  • ???? 
    The StrtvlType is the type of encoding the encoder is going to perform in relation with the String Table use.
    The version of the WBXML document is defined in the specification in the following chapter 5.4.


This package is a Java/Object/Memory representation of a WBXML document. The whole package contains the different elements that can be part a WBXML (element, attributes, PI,...) and the final WbXMLDocument is the main object that represents a final WBXML document. There are two special classes: WbXMLParser (class that reads a input stream and constructs the memory representation of the WBXML document) and WbXmlEncoder (class that writes a WbXmlDocument from the memory representation to an output stream).

The WBXML format specification defines a WBXML document like this (chapter 5.3. BNF for Document Structure):

 start       = version publicid charset strtbl body strtbl      = length *byte body        = *pi element *pi element     = stag [ 1*attribute END ] [ *content END ]  content     = element | string | extension | entity | pi | opaque  stag        = TAG | ( LITERAL index ) attribute   = attrStart *attrValue attrStart   = ATTRSTART | ( LITERAL index ) attrValue   = ATTRVALUE | string | extension | entity  extension   = ( EXT_I termstr ) | ( EXT_T index ) | EXT  string      = inline | tableref inline      = STR_I termstr tableref    = STR_T index  entity      = ENTITY entcode entcode     = mb_u_int32  // UCS-4 character code  pi          = PI attrStart *attrValue END  opaque      = OPAQUE length *byte  version     = u_int8 containing WBXML version number publicid    = mb_u_int32 | ( zero index ) charset     = mb_u_int32 termstr     = charset-dependent string with termination index       = mb_u_int32  // integer index into string table. length      = mb_u_int32  // integer length. zero        = u_int8      // containing the value zero (0). 

The different classes in this package represents a part of the previous specification (usually a class is thought to be as simple as possible). In summary this package is a way of passing from a WBXML stream to a more easy to manage memory representation and vice-versa. The stream package always convert first to this internal representation (both, reader and writer). It is fair to say that the idea is copied from the libwbxml C library. It is obvious that managing an intermediate structure is not the best in terms of performance but the WBXML specification is so complicated that it seems the most reasonable way.

Just as an example the following SI XML document is presented:

 <?xml version="1.0"?> <!DOCTYPE si PUBLIC "-//WAPFORUM//DTD SI 1.0//EN" "http://www.wapforum.org/DTD/si.dtd"> <si>   <indication href="http://www.xyz.com/email/123/abc.wml"             created="1999-06-25T15:23:15Z"             si-expires="1999-06-30T00:00:00Z">       You have 4 new emails   </indication> </si> 

It is expressed in this intermediate form as follows:

 new WbXmlDocument(     WbXmlVersion.VERSION_1_3,      WbXmlInitialization.getDefinitionByFPI("-//WAPFORUM//DTD SI 1.0//EN");,      IanaCharset.UTF_8,      new WbXmlBody(         new WbXmlElement(             "si",              new WbXmlElement(                 "indication",                 new WbXmlAttribute[] {                     new WbXmlAttribute("href", "http://www.xyz.com/email/123/abc.wml"),                     new WbXmlAttribute("created", "1999-06-25T15:23:15Z"),                     new WbXmlAttribute("si-expires", "1999-06-30T00:00:00Z")                 },                 "You have 4 new emails"             )         )     ) ); 

Copyright © 2019. All rights reserved.

Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14