net.rim.device.api.xml.parsers
Class DocumentBuilder

java.lang.Object
  |
  +--net.rim.device.api.xml.parsers.DocumentBuilder

public abstract class DocumentBuilder
extends Object

Obtains Document instances from XML documents. Retrieve an instance of this class from DocumentBuilderFactory.

Note: This class is not thread-safe. Applications must serialize access to this class if two or more threads access the same instance.

Since:
JDE 4.0.0

Constructor Summary
protected DocumentBuilder()
           
 
Method Summary
abstract  boolean getAllowUndefinedNamespaces()
          Determines whether the underlying parser is configured to allow undefined namespaces.
abstract  DOMImplementation getDOMImplementation()
          Retrieves a DOMImplementation object.
abstract  boolean isNamespaceAware()
          Determines whether the underlying parser allows namespaces.
abstract  boolean isValidating()
          Determines whether the underlying parser validates XML documents.
abstract  Document newDocument()
          Creates an empty Document object.
abstract  Document parse(InputSource is)
          Parses the content of the InputSource parameter and returns a new Document object.
 Document parse(InputStream is)
          Parses the content of the InputStream parameter and returns a new Document object.
 Document parse(InputStream is, String systemId)
          Parses the content of the InputStream parameter and returns a new Document object.
abstract  void setAllowUndefinedNamespaces(boolean allow)
          Configures the underlying parser to allow or disallow undefined namespaces.
abstract  void setEntityResolver(EntityResolver er)
          Registers the EntityResolver to use to resolve entities.
abstract  void setErrorHandler(ErrorHandler eh)
          Registers the ErrorHandler to use if an error occurs while parsing the XML document.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentBuilder

protected DocumentBuilder()
Since:
JDE 4.0.0
Method Detail

getAllowUndefinedNamespaces

public abstract boolean getAllowUndefinedNamespaces()
Determines whether the underlying parser is configured to allow undefined namespaces.
Returns:
True if the underlying parser is configured to allow undefined namespaces, false otherwise.
Since:
JDE 4.0.0

getDOMImplementation

public abstract DOMImplementation getDOMImplementation()
Retrieves a DOMImplementation object.
Returns:
A new DOMImplementation object.
Since:
JDE 4.0.0

isNamespaceAware

public abstract boolean isNamespaceAware()
Determines whether the underlying parser allows namespaces.
Returns:
True if the underlying parser allows namespaces, false otherwise.
Since:
JDE 4.0.0

isValidating

public abstract boolean isValidating()
Determines whether the underlying parser validates XML documents.
Returns:
True if the underlying parser validates XML documents, false otherwise.
Since:
JDE 4.0.0

newDocument

public abstract Document newDocument()
Creates an empty Document object.
Returns:
An empty Document object.
Since:
JDE 4.0.0

parse

public abstract Document parse(InputSource is)
                        throws IOException,
                               SAXException
Parses the content of the InputSource parameter and returns a new Document object.
Parameters:
is - Input source to parse.
Returns:
A new Document object.
Throws:
IOException - Thrown when an IO error occurs.
SAXException - Thrown when a SAX parse error occurs.
IllegalArgumentException - Thrown when the input source is null.
Since:
JDE 4.0.0

parse

public Document parse(InputStream is)
               throws SAXException,
                      IOException
Parses the content of the InputStream parameter and returns a new Document object.
Parameters:
is - Input stream to parse.
Returns:
A new Document object.
Throws:
IOException - Thrown when an IO error occurs.
IllegalArgumentException - Thrown when the input stream is null.
SAXException - Thrown when a SAX parsing error occurs.
Since:
JDE 4.0.0

parse

public Document parse(InputStream is,
                      String systemId)
               throws SAXException,
                      IOException
Parses the content of the InputStream parameter and returns a new Document object.
Parameters:
is - Input stream to parse.
systemId - Base for resolving relative URIs.
Returns:
A new Document object.
Throws:
SAXException - Thrown when a SAX parse error occurs.
IOException - Thrown when an IO error occurs.
IllegalArgumentException - Thrown when the input stream is null.
Since:
JDE 4.0.0

setAllowUndefinedNamespaces

public abstract void setAllowUndefinedNamespaces(boolean allow)
Configures the underlying parser to allow or disallow undefined namespaces.
Parameters:
allow - True to configure the underlying parser to allow undefined namespaces, false otherwise.
Since:
JDE 4.0.0

setEntityResolver

public abstract void setEntityResolver(EntityResolver er)
Registers the EntityResolver to use to resolve entities.
Parameters:
er - The EntityResolver to use to resolve entities, or null to use the default EntityResolver.
Since:
JDE 4.0.0

setErrorHandler

public abstract void setErrorHandler(ErrorHandler eh)
Registers the ErrorHandler to use if an error occurs while parsing the XML document.
Parameters:
eh - The ErrorHandler to use if an error occurs while parsing the XML document, or null to use the default ErrorHandler.
Since:
JDE 4.0.0



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