net.rim.device.api.xml.jaxp
Class WBXMLCodeBookCreationHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by net.rim.device.api.xml.jaxp.WBXMLCodeBookCreationHandler
All Implemented Interfaces:
RIMWBXMLHandler, ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public class WBXMLCodeBookCreationHandler
extends DefaultHandler
implements RIMWBXMLHandler

The WBXMLCodeBookCreationHandler class is a SAX handler for parsing WBXML codebooks. Generally it is only used internally but other programs can use it as well to parse their codebook and get the mappings back by calling the getXXXXTable() functions.

The mappings are used by the WBXML parser.

Since:
BlackBerry API 4.0.0

Constructor Summary
WBXMLCodeBookCreationHandler()
          Constructs an instance of a WBXMLCodeBookCreationHandler.
 
Method Summary
 void endElement(int ElementCode, String uri, String localName, String qName)
          Receives notification of the end of an element.
 IntHashtable getAttrStartTable()
          Retrieve the attribute start tables parsed as a IntHashtable.
 IntHashtable getAttrValueTable()
          Retrieves the attribute value tables parsed as a IntHashtable.
 long getCodeBookHash()
          Retrieve the codebook hash.
 String getCodeBookID()
          Retrieve the codebook ID.
 IntHashtable getTagTable()
          Retrieve the tag tables parsed as a IntHashtable.
 void startElement(int ElementCode, String uri, String localName, String qName, Attributes attributes)
          Implements the SAX parser startElement() method in DefaultHandler to implement parsing of the codebook.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
characters, endDocument, endElement, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 



Constructor Detail

WBXMLCodeBookCreationHandler

public WBXMLCodeBookCreationHandler()
Constructs an instance of a WBXMLCodeBookCreationHandler.

Since:
BlackBerry API 4.0.0


Method Detail

getTagTable

public IntHashtable getTagTable()
Retrieve the tag tables parsed as a IntHashtable.

Returns:
An IntHashtable of the tag table that defines the element values.
Since:
BlackBerry API 4.0.0

getAttrStartTable

public IntHashtable getAttrStartTable()
Retrieve the attribute start tables parsed as a IntHashtable.

Returns:
An IntHashtable of the attribute start table that defines the names of the attributes.
Since:
BlackBerry API 4.0.0

getAttrValueTable

public IntHashtable getAttrValueTable()
Retrieves the attribute value tables parsed as a IntHashtable.

Returns:
An IntHashtable of the attribute value table that defines the values of the attributes.
Since:
BlackBerry API 4.0.0

getCodeBookID

public String getCodeBookID()
Retrieve the codebook ID.

Returns:
The codebook ID if it exists in the codebook XML, or null otherwise.
Since:
BlackBerry API 4.0.0

getCodeBookHash

public long getCodeBookHash()
Retrieve the codebook hash.

Returns:
The codebook hash if it exists in the codebook XML, or 0 otherwise.
Since:
BlackBerry API 4.0.0

startElement

public void startElement(int ElementCode,
                         String uri,
                         String localName,
                         String qName,
                         Attributes attributes)
                  throws SAXException
Implements the SAX parser startElement() method in DefaultHandler to implement parsing of the codebook. It is not intended to be called externally.

Specified by:
startElement in interface RIMWBXMLHandler
Parameters:
ElementCode - The code of the element.
uri - The namespace URI if namespace processing is being performed; an empty string otherwise.
localName - Specify the local name if namespace processing is being performed; an empty string otherwise.
qName - Specify the qualified name if qualified names are available; an empty string otherwise.
attributes - The specified or defaulted attributes.
Throws:
SAXException - Thrown if a SAX exception, possibly wrapping another exception, occurs.
See Also:
RIMWBXMLHandler
Since:
BlackBerry API 4.0.0

endElement

public void endElement(int ElementCode,
                       String uri,
                       String localName,
                       String qName)
                throws SAXException
Description copied from interface: RIMWBXMLHandler
Receives notification of the end of an element.

By default, does nothing. Applications might override this method in a subclass to take specific actions at the end of each element, such as finalising a tree node or writing output to a file.

Specified by:
endElement in interface RIMWBXMLHandler
Parameters:
ElementCode - The code of the element.
uri - The namespace URI if namespace processing is being performed; an empty string otherwise.
localName - Specify the local name if namespace processing is being performed; an empty string otherwise.
qName - Specify the qualified name if qualified names are available; an empty string otherwise.
Throws:
SAXException - Thrown if a SAX exception, possibly wrapping another exception, occurs.
See Also:
RIMWBXMLHandler
Since:
BlackBerry API 4.0.0





Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.