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

java.lang.Object
  |
  +--net.rim.device.api.xml.jaxp.DOMInternalRepresentation

public class DOMInternalRepresentation
extends Object

The class used to represent an XML document and to implement the W3C DOM.

Since:
JDE 4.0.0

Field Summary
static boolean debug
           
 
Constructor Summary
DOMInternalRepresentation()
           
 
Method Summary
static void compress(Node n)
          Causes the DOM to compact the representation of the document containing the Node.
static void dump(Node n)
          Dump routine (for debugging only).
 boolean getCoalescing()
          Determines if this DOM merges whitespace.
 boolean getExpandingEntities()
          Determines if this DOM expands entities.
static DOMInternalRepresentation getIR(Node node)
          Given any DOM node, returns its associated DOMInternalRepresentation.
 void parse(DefaultHandler handler)
          Parses an internal representation and generates callbacks to a SAX parser handler.
static void parse(Document document, DefaultHandler handler)
          Parses an internal representation and generates callbacks to a SAX handler.
 Document parse(InputSource is, SAXParser parser)
          Parses an XML document and returns a Document node.
 DocumentFragment parseFragment(String str)
          Parses a string to produce a DocumentFragment node.
 void setCoalescing(boolean coalescing)
          Configures this DOM to turn CDATA sections into text nodes and merge adjacent text nodes.
 void setEntityResolver(EntityResolver er)
          Registers an entity resolver to use when parsing an XML document.
 void setErrorHandler(ErrorHandler eh)
          Registers an error handler to use when parsing an XML document.
 void setExpandingEntities(boolean expandingEntities)
          Configures this DOM to expand entities.
 void setIgnoringComments(boolean ignoreComments)
          Configure this DOM to discard comments.
 void setIgnoringWhitespace(boolean ignoreWhitespace)
          Configures this DOM to discard igorable whitespace, rather than saving it as text nodes.
 void setNamespaceAware(boolean aware)
          Configure this DOM to be namespace aware.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public static final boolean debug
Since:
JDE 4.0.0
Constructor Detail

DOMInternalRepresentation

public DOMInternalRepresentation()
Since:
JDE 4.0.0
Method Detail

compress

public static void compress(Node n)
Causes the DOM to compact the representation of the document containing the Node.
Parameters:
node - A DOM node.
Since:
JDE 4.0.0

dump

public static void dump(Node n)
Dump routine (for debugging only).
Parameters:
n - A node.
Since:
JDE 4.0.0

getCoalescing

public boolean getCoalescing()
Determines if this DOM merges whitespace.
Returns:
True if this DOM merges whitespace; false otherwise.
Since:
JDE 4.0.0

getExpandingEntities

public boolean getExpandingEntities()
Determines if this DOM expands entities.
Returns:
True if this DOM expands entities; false otherwise.
Since:
JDE 4.0.0

getIR

public static DOMInternalRepresentation getIR(Node node)
Given any DOM node, returns its associated DOMInternalRepresentation.
Parameters:
node - A DOM node.
Returns:
The node's DOMInternalRepresentation.
Since:
JDE 4.0.0

parse

public void parse(DefaultHandler handler)
           throws SAXException
Parses an internal representation and generates callbacks to a SAX parser handler. This is useful for creating serialization code, XML writers, and so on.
Parameters:
handler - The SAX DefaultHandler that receives the callbacks.
Since:
JDE 4.0.0

parse

public static void parse(Document document,
                         DefaultHandler handler)
                  throws SAXException
Parses an internal representation and generates callbacks to a SAX handler. This is useful for creating serialization code, XML writers, and so on.
Parameters:
document - The document to parse.
handler - The SAX DefaultHandler that receives the callbacks.
Since:
JDE 4.0.0

parse

public Document parse(InputSource is,
                      SAXParser parser)
               throws SAXException,
                      IOException
Parses an XML document and returns a Document node.
Parameters:
is - The XML document.
parser - A SAX parser capable of parsing the InputSource.
Returns:
A Document node that represents the XML document.
Since:
JDE 4.0.0

parseFragment

public DocumentFragment parseFragment(String str)
                               throws SAXException,
                                      IOException

Parses a string to produce a DocumentFragment node.

Parameters:
str - The string to parse.
Returns:
A document fragment that represents the parsed string.
Throws:
IOException -  
SAXException -  
Since:
JDE 4.0.0

setCoalescing

public void setCoalescing(boolean coalescing)
Configures this DOM to turn CDATA sections into text nodes and merge adjacent text nodes.
Parameters:
coalescing - True to configure this DOM to turn CDATA sections into text nodes and merge adjacent text nodes; false otherwise.
Since:
JDE 4.0.0

setEntityResolver

public void setEntityResolver(EntityResolver er)
Registers an entity resolver to use when parsing an XML document.
Parameters:
er - An EntityResolver.
Since:
JDE 4.0.0

setErrorHandler

public void setErrorHandler(ErrorHandler eh)
Registers an error handler to use when parsing an XML document.
Parameters:
eh - An error handler.
Since:
JDE 4.0.0

setExpandingEntities

public void setExpandingEntities(boolean expandingEntities)
Configures this DOM to expand entities. When entities are not being expanded, an Entity node appears in the DOM. The children of the Entity represent its expansion. When entities are being expanded, no Entity node appears.
Parameters:
expandingEntities - True to expand entities; false otherwise.
Since:
JDE 4.0.0

setIgnoringComments

public void setIgnoringComments(boolean ignoreComments)
Configure this DOM to discard comments.
Parameters:
ignoreComments - True to configure this DOM to discard comments; false otherwise.
Since:
JDE 4.0.0

setIgnoringWhitespace

public void setIgnoringWhitespace(boolean ignoreWhitespace)
Configures this DOM to discard igorable whitespace, rather than saving it as text nodes.
Parameters:
ignoreWhitespace - True to configure this DOM to discard ignorable whitespace; false otherwise.
Since:
JDE 4.0.0

setNamespaceAware

public void setNamespaceAware(boolean aware)
Configure this DOM to be namespace aware.
Parameters:
aware - True to configure this DOM to be namespace aware; false otherwise.
Since:
JDE 4.3.0



Copyright 1999-2008 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.