|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.xml.sax.helpers.DefaultHandler
|
+--net.rim.device.api.xml.jaxp.WBXMLWriter
This class implements an XML writer as a SAX parser handler. The writer can be passed to
any parser and will write XML to the specified OutputStream.
| Field Summary |
| Fields inherited from interface net.rim.device.api.xml.WBXMLConstants |
CHARSET_ISO_8859_1, CHARSET_UTF_8, END, ENTITY, EXT_0, EXT_1, EXT_2, EXT_I_0, EXT_I_1, EXT_I_2, EXT_T_0, EXT_T_1, EXT_T_2, ISO_8859_1, LITERAL, LITERAL_A, LITERAL_AC, LITERAL_C, OPAQUE, PI, PUBLIC_ID_UNKNOWN, PUBLIC_ID_WML10, PUBLIC_ID_WML11, PUBLIC_ID_WML12, PUBLIC_ID_WML13, STR_I, STR_T, SWITCH_PAGE, UTF_8, WBXML_1_1, WBXML_1_2, WBXML_1_3 |
| Constructor Summary | ||
WBXMLWriter(OutputStream out)
This class implements an XML writer as a SAX parser handler. |
||
| Method Summary | ||
void |
cdataSection(char[] text,
int offset,
int length)
|
|
void |
characters(char[] ch,
int start,
int length)
DefaultHandler overrides |
|
void |
comment(char[] text,
int offset,
int length)
|
|
void |
defaultAttribute(String element,
String attribute,
String defaultValue)
|
|
void |
endDocument()
|
|
void |
endDTD(String name,
String publicIdStr,
String systemId,
String body)
|
|
void |
endElement(String uri,
String localName,
String qName)
|
|
void |
endEntityReference(String name)
|
|
void |
entityDecl(String name,
String value)
|
|
void |
ignorableWhitespace(char[] ch,
int start,
int length)
|
|
void |
processingInstruction(String target,
String data)
|
|
InputSource |
resolveEntity(String publicId,
String systemId)
|
|
void |
setAttrStartTable(int page,
String[] attrStartTable)
Sets the attribute start Table for a given page. |
|
void |
setAttrValueTable(int page,
String[] attrValueTable)
Sets the attribute value Table for a given page. |
|
void |
setCharset(int charset)
Sets the character set for the written WBXML. |
|
void |
setEncoding(String encoding)
Sets the encoding for the written WBXML. |
|
void |
setEntityResolver(EntityResolver entityResolver)
Sets the entity resolver for this writer. |
|
void |
setPublicID(int publicID)
Sets the written WBXML public ID. |
|
void |
setTagTable(int page,
String[] tagTable)
Sets the tag table for a given page. |
|
void |
setVersion(int version)
Sets the version of WBXML to write. |
|
void |
startAndEndElement(String eUri,
String localName,
String qName,
Attributes attributes)
|
|
void |
startDocument()
|
|
void |
startDTD()
Implementation of RIMExtendedHandler |
|
void |
startElement(String eUri,
String localName,
String qName,
Attributes attributes)
|
|
void |
startEntityReference(String name,
String publicId,
String systemId)
|
|
void |
startPrefixMapping(String prefix,
String uri)
|
|
| Methods inherited from class org.xml.sax.helpers.DefaultHandler |
endPrefixMapping, error, fatalError, notationDecl, setDocumentLocator, skippedEntity, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public WBXMLWriter(OutputStream out)
OutputStream.out - A stream to receive the XML output.| Method Detail |
public void setCharset(int charset)
charset - The character set must be one of CHARSET_ISO_8859_1 or CHARSET_UTF_8.public void setPublicID(int publicID)
publicId - The public ID must be one of PUBLIC_ID_WML10, PUBLIC_ID_WML11, PUBLIC_ID_WML12, or PUBLIC_ID_WML13.public void setVersion(int version)
The - version must be one of WBXML_1_1, WBXML_1_2, or WBXML_1_3.
public void setTagTable(int page,
String[] tagTable)
page - The page number.tagTable - The tags to define.
public void setAttrStartTable(int page,
String[] attrStartTable)
page - The page number.attrStartTable - The attribute names to define.
public void setAttrValueTable(int page,
String[] attrValueTable)
page - The page number.attrValueTable - The attribute names to define.public void setEncoding(String encoding) throws IOException
encoding - The encoding must be one of UTF_8 or ISO_8859_1.IllegalArgumentException - Thrown if the encoding is
not supported for WBXML.public void setEntityResolver(EntityResolver entityResolver)
entityResolver - The entity resolver.public void endDTD(String name, String publicIdStr, String systemId, String body) throws SAXException
RIMExtendedHandler
public void comment(char[] text,
int offset,
int length)
throws SAXException
RIMExtendedHandler
public void cdataSection(char[] text,
int offset,
int length)
throws SAXException
RIMExtendedHandlerpublic void startEntityReference(String name, String publicId, String systemId) throws SAXException
RIMExtendedHandlerpublic void endEntityReference(String name) throws SAXException
RIMExtendedHandlerpublic void entityDecl(String name, String value) throws SAXException
RIMExtendedHandlerpublic void defaultAttribute(String element, String attribute, String defaultValue) throws SAXException
RIMExtendedHandler
public void characters(char[] ch,
int start,
int length)
throws SAXException
characters in class DefaultHandler
public void ignorableWhitespace(char[] ch,
int start,
int length)
throws SAXException
DefaultHandlerBy default, do nothing. Application writers may override this method to take specific actions for each chunk of ignorable whitespace (such as adding data to a node or buffer, or printing it to a file).
ignorableWhitespace in class DefaultHandlerpublic void processingInstruction(String target, String data) throws SAXException
DefaultHandlerBy default, do nothing. Application writers may override this method in a subclass to take specific actions for each processing instruction, such as setting status variables or invoking other methods.
processingInstruction in class DefaultHandler
public void startDocument()
throws SAXException
DefaultHandlerBy default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).
startDocument in class DefaultHandler
public void endDocument()
throws SAXException
DefaultHandlerBy default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of a document (such as finalising a tree or closing an output file).
endDocument in class DefaultHandlerpublic void startAndEndElement(String eUri, String localName, String qName, Attributes attributes) throws SAXException
RIMExtendedHandlerpublic void startElement(String eUri, String localName, String qName, Attributes attributes) throws SAXException
DefaultHandlerBy default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
startElement in class DefaultHandlerpublic void endElement(String uri, String localName, String qName) throws SAXException
DefaultHandlerBy default, do nothing. Application writers may 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).
endElement in class DefaultHandlerpublic void startPrefixMapping(String prefix, String uri) throws SAXException
DefaultHandlerBy default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each Namespace prefix scope (such as storing the prefix mapping).
startPrefixMapping in class DefaultHandlerpublic InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException
DefaultHandlerAlways return null, so that the parser will use the system identifier provided in the XML document. This method implements the SAX default behaviour: application writers can override it in a subclass to do special translations such as catalog lookups or URI redirection.
resolveEntity in class DefaultHandler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 1999-2006 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.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.