org.barracudamvc.core.util.dom
Interface DOMFactory

All Known Implementing Classes:
JivanDOMFactory, XMLCDeferredParsingDOMFactory, XMLCStdDOMFactory

public interface DOMFactory

This interface defines the methods needed to implement a DOMFactory. A dom factory is not meant to be called directly, but by the chosen dom loader implementation.

There are two possible ways for loading a DOM: from a class and from a path to a document. It is not required for both to be supported at the same time.

Where Implementations do not support a particular getInstance() method, they should simply throw an IOException and document their lack of support.

See Also:
DOMLoader

Method Summary
 Document getInstance(Class clazz)
          Obtain an instance of the DOM from a loaded class.
 Document getInstance(String docPath)
          Obtain an instance of the DOM from a path to a document.
 

Method Detail

getInstance

Document getInstance(Class clazz)
                     throws IOException
Obtain an instance of the DOM from a loaded class. This is here to support dom implementations such as XMLC which wrap the DOM up in a compiled class.

Parameters:
clazz - the class to be loaded as a Document object
Returns:
a Document object
Throws:
IOException

getInstance

Document getInstance(String docPath)
                     throws IOException
Obtain an instance of the DOM from a path to a document. The syntax of the path depends on the implementation.

Depending on the dom factory implementation, the docPath may be an OS-specifc hardcoded path, a path relative to a known hardcoded path, a path to a document located within the classloader, or anything else one can imagine. See the doc of the various dom factory implementations for details.

Parameters:
docPath - the path to the document to be loaded as a Document object
Returns:
a Document object
Throws:
IOException


Copyright © 2006 BarracudaMVC.org All Rights Reserved.