|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ozoneDB.xml.DOMFactory
Factory for XML, HTML and DTD documents, parsers and printers. The factory
has methods for creating new documents, parsers and printers. The exact
type is determined by the document class, this might be Document
(DOCUMENT_XML
), HTMLDocument
(DOCUMENT_HTML
),
DocumentType
(DOCUMENT_DTD
) or a user document derived from
XMLDocument
.
The default document type is controlled by the openxml.document.class propety in the OpenXML properties file ( openxml.prop). The parser and printer classes for XML, HTML and DTD documents are also controlled by the property file.
The method createDocument(java.lang.Class)
does not guarantee that it will return
Document
, although this is the default behavior. To obtain a
Document
either pass its class as argument, or call createXMLDocument()
.
A newly created parser is only guaranteed to extend Parser
, even
if DOCUMENT_XML
has been specified as the document type. To create
a document from a user class, either use Source
, or the following
code:
Parser parser; parser = DOMFactory.createParser( reader, sourceURI, docClass ); if ( parser instanceof XMLParser ) doc = ( (XMLParser) parser ).parseDocument( null, docClass ); else doc = parser.parseDocument();
Document
,
XMLElement
,
XMLCollection
Field Summary | |
static java.lang.Class |
DOCUMENT_DTD
DTD document class. |
static java.lang.Class |
DOCUMENT_HTML
HTML document class. |
static java.lang.Class |
DOCUMENT_XML
XML document class. |
Constructor Summary | |
DOMFactory()
|
Method Summary | |
static org.w3c.dom.Document |
createDocument(java.lang.Class docClass)
Creates and returns a new XML/HTML/DTD document. |
static DTDDocument |
createDTDDocument()
Creates and returns a new DTD document. |
static org.w3c.dom.html.HTMLDocument |
createHTMLDocument()
Creates and returns a new HTML document. |
static org.w3c.dom.Document |
createXMLDocument()
Creates and returns a new XML document. |
static java.lang.Class |
getDocClass(java.lang.Class docClass)
Returns the specified document class, or the properties file specified class, or the default. |
static java.util.Properties |
getProperties()
Returns the properties list from the OpenXML properties file. |
static java.lang.String |
getProperty(java.lang.String name)
Returns the property from the OpenXML properties file. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.Class DOCUMENT_XML
Document
.
public static final java.lang.Class DOCUMENT_HTML
HTMLDocument
.
public static final java.lang.Class DOCUMENT_DTD
DTDDocument
.
Constructor Detail |
public DOMFactory()
Method Detail |
public static org.w3c.dom.Document createXMLDocument()
Document
.
Document
public static org.w3c.dom.html.HTMLDocument createHTMLDocument()
HTMLDocument
.
HTMLDocument
public static DTDDocument createDTDDocument()
DTDDocument
.
DTDDocument
public static org.w3c.dom.Document createDocument(java.lang.Class docClass)
Document
is used.
Note that the returned document type may or may not be Document
,
but it must extend Document
, and that is also true for non-XML
documents.
Document
public static java.lang.String getProperty(java.lang.String name)
name
- The property name
public static java.util.Properties getProperties()
public static java.lang.Class getDocClass(java.lang.Class docClass)
Document
) is used.
docClass
- The specified document class, or null
Document
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |