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
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateAttribute(Element owner, QName qname, String value) createDocument(String namespaceURI, String qualifiedName, DocumentType docType) protected XHTMLDocumentcreateDocument(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 XHTMLDocumentFactoryGets the instance of the document factory.Gets the CSS style sheet factory.booleanIndicates whether the stylable elements currently produced by this factory are cache-enabled or not.voidsetStyleCache(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, hasFeatureMethods 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:
trueif the per-element cache is enabled,falseotherwise.
-
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:
createElementin classDocumentFactory
-
createElement
- Overrides:
createElementin classDocumentFactory
-
createElement
- Overrides:
createElementin classDOMDocumentFactory
-
createElement
- Overrides:
createElementin classDOMDocumentFactory
-
createDocument
- Overrides:
createDocumentin classDOMDocumentFactory
-
createDocument
- Overrides:
createDocumentin classDocumentFactory
-
createDocument
-
createDocument
public XHTMLDocument createDocument(String namespaceURI, String qualifiedName, DocumentType docType) throws DOMException - Specified by:
createDocumentin interfaceDOMImplementation- Overrides:
createDocumentin classDOMDocumentFactory- Throws:
DOMException
-
createAttribute
- Overrides:
createAttributein classDOMDocumentFactory
-
getFeature
Deprecated.- Specified by:
getFeaturein interfaceDOMImplementation- Overrides:
getFeaturein classDOMDocumentFactory
-