java.lang.Object
org.dom4j.DocumentFactory
org.dom4j.dom.DOMDocumentFactory
io.sf.carte.doc.dom4j.XHTMLDocumentFactory
- All Implemented Interfaces:
Serializable
,DOMImplementation
- Direct Known Subclasses:
DOM4JUserAgent.AgentXHTMLDocumentFactory
DocumentFactory for CSS-styled XHTML documents.
This factory creates XHTMLDocuments and other objects with support for CSS style sheets.
It is possible to produce elements with the ability to cache its own computed
style, if you call setStyleCache(true)
. Although the performance
benefit is generally not noticeable, in some corner cases it could enhance
performance for applications that may call the
getComputedStyle()
method of a single stylable element many
times. Due to the generally negligible performance gain, cache is off by
default.
- See Also:
-
Field Summary
Fields inherited from class org.dom4j.DocumentFactory
cache
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateAttribute
(Element owner, QName qname, String value) createDocument
(String namespaceURI, String qualifiedName, DocumentType docType) protected XHTMLDocument
createDocument
(DOMDocumentType documentType) createDocument
(Element rootElement) createElement
(String name) createElement
(String qualifiedName, String namespaceURI) createElement
(QName qname) createElement
(QName qname, int attributeCount) getFeature
(String feature, String version) Deprecated.static XHTMLDocumentFactory
Gets the instance of the document factory.Gets the CSS style sheet factory.boolean
Indicates whether the stylable elements currently produced by this factory are cache-enabled or not.void
setStyleCache
(boolean onOff) Can turn on or off the per-Element style caching capability (by default is off).Methods inherited from class org.dom4j.dom.DOMDocumentFactory
asDocumentType, createCDATA, createComment, createDocType, createDocumentType, createEntity, createEntity, createNamespace, createProcessingInstruction, createProcessingInstruction, createText, hasFeature
Methods inherited from class org.dom4j.DocumentFactory
createAttribute, createDocument, createPattern, createQName, createQName, createQName, createQName, createQNameCache, createSingleton, createXPath, createXPath, createXPathFilter, createXPathFilter, getQNames, getXPathNamespaceURIs, init, intern, setXPathNamespaceURIs
-
Constructor Details
-
XHTMLDocumentFactory
protected XHTMLDocumentFactory() -
XHTMLDocumentFactory
-
-
Method Details
-
getInstance
Gets the instance of the document factory.- Returns:
- the XHTML (DOM4J-derived) document factory instance.
-
getStyleSheetFactory
Gets the CSS style sheet factory.- Returns:
- the CSS style sheet factory.
-
isStyleCacheOn
public boolean isStyleCacheOn()Indicates whether the stylable elements currently produced by this factory are cache-enabled or not.- Returns:
true
if the per-element cache is enabled,false
otherwise.
-
setStyleCache
public void setStyleCache(boolean onOff) Can turn on or off the per-Element style caching capability (by default is off).Only applications that repeatedly call the
CSSStylableElement.getComputedStyle()
method on the same Element should turn it on.- Parameters:
onOff
- set to true to turn on the cache capability, to false to turn it off.
-
createElement
- Overrides:
createElement
in classDocumentFactory
-
createElement
- Overrides:
createElement
in classDocumentFactory
-
createElement
- Overrides:
createElement
in classDOMDocumentFactory
-
createElement
- Overrides:
createElement
in classDOMDocumentFactory
-
createDocument
- Overrides:
createDocument
in classDOMDocumentFactory
-
createDocument
- Overrides:
createDocument
in classDocumentFactory
-
createDocument
-
createDocument
public XHTMLDocument createDocument(String namespaceURI, String qualifiedName, DocumentType docType) throws DOMException - Specified by:
createDocument
in interfaceDOMImplementation
- Overrides:
createDocument
in classDOMDocumentFactory
- Throws:
DOMException
-
createAttribute
- Overrides:
createAttribute
in classDOMDocumentFactory
-
getFeature
Deprecated.- Specified by:
getFeature
in interfaceDOMImplementation
- Overrides:
getFeature
in classDOMDocumentFactory
-