org.dom4j
public class DocumentFactory extends Object implements Serializable
DocumentFactory
is a collection of factory methods to allow
easy custom building of DOM4J trees. The default tree that is built uses a
doubly linked tree.
The tree built allows full XPath expressions from anywhere on the tree.
Field Summary | |
---|---|
protected QNameCache | cache |
Constructor Summary | |
---|---|
DocumentFactory() |
Method Summary | |
---|---|
Attribute | createAttribute(Element owner, QName qname, String value) |
Attribute | createAttribute(Element owner, String name, String value) |
CDATA | createCDATA(String text) |
Comment | createComment(String text) |
DocumentType | createDocType(String name, String publicId, String systemId) |
Document | createDocument() |
Document | createDocument(String encoding)
DOCUMENT ME!
|
Document | createDocument(Element rootElement) |
Element | createElement(QName qname) |
Element | createElement(String name) |
Element | createElement(String qualifiedName, String namespaceURI) |
Entity | createEntity(String name, String text) |
Namespace | createNamespace(String prefix, String uri) |
Pattern | createPattern(String xpathPattern)
|
ProcessingInstruction | createProcessingInstruction(String target, String data) |
ProcessingInstruction | createProcessingInstruction(String target, Map data) |
QName | createQName(String localName, Namespace namespace) |
QName | createQName(String localName) |
QName | createQName(String name, String prefix, String uri) |
QName | createQName(String qualifiedName, String uri) |
protected QNameCache | createQNameCache()
Factory method to create the QNameCache. |
protected static DocumentFactory | createSingleton(String className)
|
Text | createText(String text) |
XPath | createXPath(String xpathExpression)
|
XPath | createXPath(String xpathExpression, VariableContext variableContext)
|
NodeFilter | createXPathFilter(String xpathFilterExpression, VariableContext variableContext)
|
NodeFilter | createXPathFilter(String xpathFilterExpression)
|
static DocumentFactory | getInstance() Access to singleton implementation of DocumentFactory which is used if no DocumentFactory is specified when building using the standard builders. |
List | getQNames()
Returns a list of all the QName instances currently used by this document
factory
|
Map | getXPathNamespaceURIs()
DOCUMENT ME!
|
protected void | init() |
protected QName | intern(QName qname)
DOCUMENT ME!
|
void | setXPathNamespaceURIs(Map namespaceURIs)
Sets the namespace URIs to be used by XPath expressions created by this
factory or by nodes associated with this factory. |
Parameters: encoding DOCUMENT ME!
Returns: DOCUMENT ME!
Since: 1.5
createPattern
parses the given XPath expression to create
an XSLT style {@link Pattern}instance which can then be used in an XSLT
processing model.
Parameters: xpathPattern is the XPath pattern expression to create
Returns: a new Pattern
instance
Returns: DOCUMENT ME!
createSingleton
creates the singleton instance from the
given class name.
Parameters: className is the name of the DocumentFactory class to use
Returns: a new singleton instance.
createXPath
parses an XPath expression and creates a new
XPath XPath
instance.
Parameters: xpathExpression is the XPath expression to create
Returns: a new XPath
instance
Throws: InvalidXPathException if the XPath expression is invalid
createXPath
parses an XPath expression and creates a new
XPath XPath
instance.
Parameters: xpathExpression is the XPath expression to create variableContext is the variable context to use when evaluating the XPath
Returns: a new XPath
instance
createXPathFilter
parses a NodeFilter from the given XPath
filter expression. XPath filter expressions occur within XPath
expressions such as self::node()[ filterExpression ]
Parameters: xpathFilterExpression is the XPath filter expression to create variableContext is the variable context to use when evaluating the XPath
Returns: a new NodeFilter
instance
createXPathFilter
parses a NodeFilter from the given XPath
filter expression. XPath filter expressions occur within XPath
expressions such as self::node()[ filterExpression ]
Parameters: xpathFilterExpression is the XPath filter expression to create
Returns: a new NodeFilter
instance
Access to singleton implementation of DocumentFactory which is used if no DocumentFactory is specified when building using the standard builders.
Returns: the default singleon instance
Returns: DOCUMENT ME!
Returns: the Map of namespace URIs that will be used by by XPath expressions to resolve namespace prefixes into namespace URIs. The map is keyed by namespace prefix and the value is the namespace URI. This value could well be null to indicate no namespace URIs are being mapped.
Parameters: qname DOCUMENT ME!
Returns: the cached QName instance if there is one or adds the given qname to the cache if not
Parameters: namespaceURIs DOCUMENT ME!