org.apache.batik.dom.util

Interface DocumentFactory

public interface DocumentFactory

This interface represents an object which can build a Document.
Method Summary
DocumentcreateDocument(String ns, String root, String uri)
Creates a Document instance.
DocumentcreateDocument(String ns, String root, String uri, InputStream is)
Creates a Document instance.
DocumentcreateDocument(String ns, String root, String uri, XMLReader r)
Creates a Document instance.
DocumentcreateDocument(String ns, String root, String uri, Reader r)
Creates a Document instance.
DocumentDescriptorgetDocumentDescriptor()
Returns the document descriptor associated with the latest created document.
booleanisValidating()
Returns true if the XML stream has to be validated, false otherwise.
voidsetValidating(boolean isValidating)
Sets whether or not the XML stream has to be validate, depending on the specified parameter.

Method Detail

createDocument

public Document createDocument(String ns, String root, String uri)
Creates a Document instance.

Parameters: ns The namespace URI of the root element of the document. root The name of the root element of the document. uri The document URI.

Throws: IOException if an error occured while reading the document.

createDocument

public Document createDocument(String ns, String root, String uri, InputStream is)
Creates a Document instance.

Parameters: ns The namespace URI of the root element of the document. root The name of the root element of the document. uri The document URI. is The document input stream.

Throws: IOException if an error occured while reading the document.

createDocument

public Document createDocument(String ns, String root, String uri, XMLReader r)
Creates a Document instance.

Parameters: ns The namespace URI of the root element of the document. root The name of the root element of the document. uri The document URI. r An XMLReader instance

Throws: IOException if an error occured while reading the document.

createDocument

public Document createDocument(String ns, String root, String uri, Reader r)
Creates a Document instance.

Parameters: ns The namespace URI of the root element of the document. root The name of the root element of the document. uri The document URI. r The document reader.

Throws: IOException if an error occured while reading the document.

getDocumentDescriptor

public DocumentDescriptor getDocumentDescriptor()
Returns the document descriptor associated with the latest created document.

Returns: null if no document or descriptor was previously generated.

isValidating

public boolean isValidating()
Returns true if the XML stream has to be validated, false otherwise.

setValidating

public void setValidating(boolean isValidating)
Sets whether or not the XML stream has to be validate, depending on the specified parameter.

Parameters: isValidating true implies the XML stream will be validated

Copyright B) 2008 Apache Software Foundation. All Rights Reserved.