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)
          tell the DOM to compact the representation of the document containing the Node
static void dump(Node n)
           
 boolean getCoalescing()
          Does this DOM coalesce whitespace?
 boolean getExpandingEntities()
          Does this DOM expand entities?
static DOMInternalRepresentation getIR(Node node)
          Given any DOM node, return its associated DOMInternalRepresentation
 void parse(DefaultHandler handler)
          This method allows you to "parse" an internal representation and generate callbacks to a SAX parser handler.
static void parse(Document document, DefaultHandler handler)
          This method allows you to "parse" an internal representation and generate callbacks to a SAX handler.
 Document parse(InputSource is, SAXParser parser)
          Parse an XML document and return a Document node
 DocumentFragment parseFragment(String str)
           
 void setCoalescing(boolean coalescing)
          Indicate whether this DOM should turn CDATA sections into Text nodes, and then coalesce adjacent Text nodes
 void setEntityResolver(EntityResolver er)
          Set the entity resolver to be used when parsing an XML document
 void setErrorHandler(ErrorHandler eh)
          Set the error handler to be used when parsing an XML document
 void setExpandingEntities(boolean expandingEntities)
          Indicate whether this DOM should expand entities.
 void setIgnoringComments(boolean ignoreComments)
          Indicate whether this DOM should discard comments
 void setIgnoringWhitespace(boolean ignoreWhitespace)
          Indicate whether this DOM should discard igorable whitespace, rather than saving it as text nodes
 
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

parseFragment

public DocumentFragment parseFragment(String str)
                               throws SAXException,
                                      IOException
Since:
JDE 4.0.2

parse

public Document parse(InputSource is,
                      SAXParser parser)
               throws SAXException,
                      IOException
Parse an XML document and return a Document node
Parameters:
is - The XML document
parser - a SAX parser capable of parsing the InputSource
Returns:
a Document node representing the XML document
Since:
JDE 4.0.2

setErrorHandler

public void setErrorHandler(ErrorHandler eh)
Set the error handler to be used when parsing an XML document
Parameters:
eh - an error handler
Since:
JDE 4.0.2

setEntityResolver

public void setEntityResolver(EntityResolver er)
Set the entity resolver to be used when parsing an XML document
Parameters:
er - an EntityResolver
Since:
JDE 4.0.2

setCoalescing

public void setCoalescing(boolean coalescing)
Indicate whether this DOM should turn CDATA sections into Text nodes, and then coalesce adjacent Text nodes
Parameters:
coalescing - true if coalescing should be performed.
Since:
JDE 4.0.2

setIgnoringWhitespace

public void setIgnoringWhitespace(boolean ignoreWhitespace)
Indicate whether this DOM should discard igorable whitespace, rather than saving it as text nodes
Parameters:
ignoreWhitespace - true if whitespace should be ignored
Since:
JDE 4.0.2

setIgnoringComments

public void setIgnoringComments(boolean ignoreComments)
Indicate whether this DOM should discard comments
Parameters:
ignoreComments - true if whitespace should be ignored
Since:
JDE 4.0.2

setExpandingEntities

public void setExpandingEntities(boolean expandingEntities)
Indicate whether this DOM should expand entities. When entities are not being expanded, an Entity Node will appear in the DOM. The children of the Entity represent its expansion. When entities are being expanded, no Entity node appears.
Parameters:
expandingEntities - true if entites should be expanded
Since:
JDE 4.0.2

getCoalescing

public boolean getCoalescing()
Does this DOM coalesce whitespace?
Returns:
true if this DOM is coalescing whitespace
Since:
JDE 4.0.0

getExpandingEntities

public boolean getExpandingEntities()
Does this DOM expand entities?
Returns:
true if this DOM is expanding entities
Since:
JDE 4.0.0

getIR

public static DOMInternalRepresentation getIR(Node node)
Given any DOM node, return its associated DOMInternalRepresentation
Parameters:
node - a DOM node
Returns:
the node's DOMInternalRepresentation
Since:
JDE 4.0.2

parse

public static void parse(Document document,
                         DefaultHandler handler)
                  throws SAXException
This method allows you to "parse" an internal representation and generate callbacks to a SAX handler. This is useful for creating serialization code, XML writers, etc
Parameters:
document - the document to parse
handler - the SAX DefaultHandler that will receive the callbacks
Since:
JDE 4.0.2

parse

public void parse(DefaultHandler handler)
           throws SAXException
This method allows you to "parse" an internal representation and generate callbacks to a SAX parser handler. This is useful for creating serialization code, XML writers, etc
Parameters:
handler - the SAX DefaultHandler that will receive the callbacks
Since:
JDE 4.0.2

compress

public static void compress(Node n)
tell the DOM to compact the representation of the document containing the Node
Parameters:
node -  
Since:
JDE 4.0.2

dump

public static void dump(Node n)
Since:
JDE 4.0.2


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