org.newsml.toolkit.dom
Class DOMNewsMLFactory

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

public class DOMNewsMLFactory
extends java.lang.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.0
Author:
Reuters PLC

Constructor Summary
DOMNewsMLFactory(DOMFactory factory)
          Constructor.
DOMNewsMLFactory(DOMFactory factory, boolean validation)
          Constructor.
 
Method Summary
 NewsML createNewsML(java.io.Reader input, java.lang.String baseURL)
          Create a top-level NewsML object from a character stream.
 NewsML createNewsML(java.lang.String url)
          Create a top-level NewsML object from a URL.
 BaseNode createNode(java.io.Reader input, java.lang.String baseURL)
          Create a NewsML node from a URL.
 BaseNode createNode(java.lang.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(DOMFactory factory)
Constructor.
Parameters:
factory - The factory object for creating new DOM documents.

DOMNewsMLFactory

public DOMNewsMLFactory(DOMFactory factory,
                        boolean validation)
                 throws java.io.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:
java.io.IOException - if the implementation does not support the requested validation state.
Method Detail

setValidation

public void setValidation(boolean validation)
                   throws java.io.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(java.lang.String url)
                    throws java.io.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(java.io.Reader input,
                           java.lang.String baseURL)
                    throws java.io.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(java.lang.String url)
                    throws java.io.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(java.io.Reader input,
                           java.lang.String baseURL)
                    throws java.io.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)