org.newsml.toolkit.dom
Class DOMNewsMLFactory

java.lang.Object
  |
  +--org.newsml.toolkit.dom.DOMNewsMLFactory
All Implemented Interfaces:
NewsMLFactory

public class DOMNewsMLFactory
extends Object
implements NewsMLFactory

DOM implementation of NewsMLFactory.

This implementation uses yet another factory class, DOMFactory, to allow the user to plug in different DOM implementations. A default XercesDOMFactory is included with this distribution.

Version:
1.1beta
Author:
Reuters PLC

Constructor Summary
DOMNewsMLFactory()
          Default constructor (uses Xerces).
DOMNewsMLFactory(DOMFactory factory)
          Constructor.
DOMNewsMLFactory(DOMFactory factory, boolean validation)
          Constructor.
 
Method Summary
 NewsML createNewsML(Reader input, String baseURL)
          Create a top-level NewsML object from a character stream.
 NewsML createNewsML(String url)
          Create a top-level NewsML object from a URL.
 BaseNode createNode(Reader input, String baseURL)
          Create a NewsML node from a URL.
 BaseNode createNode(String url)
          Create a NewsML node from a URL.
 boolean getValidation()
          Get the validation flag.
 void setValidation(boolean validation)
          Set the validation flag.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DOMNewsMLFactory

public DOMNewsMLFactory()
Default constructor (uses Xerces).

DOMNewsMLFactory

public DOMNewsMLFactory(DOMFactory factory)
Constructor.
Parameters:
factory - The factory object for creating new DOM documents.

DOMNewsMLFactory

public DOMNewsMLFactory(DOMFactory factory,
                        boolean validation)
                 throws IOException
Constructor.
Parameters:
factory - The factory object for creating new DOM documents.
validation - true if DTD validation is required, false if it is forbidden.
Throws:
IOException - if the implementation does not support the requested validation state.
Method Detail

setValidation

public void setValidation(boolean validation)
                   throws IOException
Description copied from interface: NewsMLFactory
Set the validation flag.
Specified by:
setValidation in interface NewsMLFactory
See Also:
NewsMLFactory.setValidation(boolean)

getValidation

public boolean getValidation()
Description copied from interface: NewsMLFactory
Get the validation flag.
Specified by:
getValidation in interface NewsMLFactory
See Also:
NewsMLFactory.getValidation()

createNewsML

public NewsML createNewsML(String url)
                    throws IOException
Description copied from interface: NewsMLFactory
Create a top-level NewsML object from a URL.
Specified by:
createNewsML in interface NewsMLFactory
See Also:
NewsMLFactory.createNewsML(String)

createNewsML

public NewsML createNewsML(Reader input,
                           String baseURL)
                    throws IOException
Description copied from interface: NewsMLFactory
Create a top-level NewsML object from a character stream.
Specified by:
createNewsML in interface NewsMLFactory
See Also:
NewsMLFactory.createNewsML(Reader,String)

createNode

public BaseNode createNode(String url)
                    throws IOException
Description copied from interface: NewsMLFactory
Create a NewsML node from a URL.
Specified by:
createNode in interface NewsMLFactory
See Also:
NewsMLFactory.createNode(String)

createNode

public BaseNode createNode(Reader input,
                           String baseURL)
                    throws IOException
Description copied from interface: NewsMLFactory
Create a NewsML node from a URL.
Specified by:
createNode in interface NewsMLFactory
See Also:
NewsMLFactory.createNode(Reader,String)