|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dom4j.DocumentFactory
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,
java.lang.String value)
|
Attribute |
createAttribute(Element owner,
java.lang.String name,
java.lang.String value)
|
CDATA |
createCDATA(java.lang.String text)
|
Comment |
createComment(java.lang.String text)
|
DocumentType |
createDocType(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId)
|
Document |
createDocument()
|
Document |
createDocument(Element rootElement)
|
Element |
createElement(QName qname)
|
Element |
createElement(java.lang.String name)
|
Element |
createElement(java.lang.String qualifiedName,
java.lang.String namespaceURI)
|
Entity |
createEntity(java.lang.String name,
java.lang.String text)
|
Namespace |
createNamespace(java.lang.String prefix,
java.lang.String uri)
|
Pattern |
createPattern(java.lang.String xpathPattern)
createPattern parses the given
XPath expression to create an XSLT style Pattern instance
which can then be used in an XSLT processing model. |
ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.util.Map data)
|
ProcessingInstruction |
createProcessingInstruction(java.lang.String target,
java.lang.String data)
|
QName |
createQName(java.lang.String localName)
|
QName |
createQName(java.lang.String localName,
Namespace namespace)
|
QName |
createQName(java.lang.String qualifiedName,
java.lang.String uri)
|
QName |
createQName(java.lang.String name,
java.lang.String prefix,
java.lang.String uri)
|
protected QNameCache |
createQNameCache()
Factory method to create the QNameCache. |
protected static DocumentFactory |
createSingleton(java.lang.String className)
createSingleton creates the singleton instance
from the given class name. |
Text |
createText(java.lang.String text)
|
XPath |
createXPath(java.lang.String xpathExpression)
createXPath parses an XPath expression
and creates a new XPath XPath instance. |
XPath |
createXPath(java.lang.String xpathExpression,
org.jaxen.VariableContext variableContext)
createXPath parses an XPath expression
and creates a new XPath XPath instance. |
NodeFilter |
createXPathFilter(java.lang.String xpathFilterExpression)
createXPathFilter parses a NodeFilter
from the given XPath filter expression.
|
NodeFilter |
createXPathFilter(java.lang.String xpathFilterExpression,
org.jaxen.VariableContext variableContext)
createXPathFilter parses a NodeFilter
from the given XPath filter expression.
|
static DocumentFactory |
getInstance()
Access to singleton implementation of DocumentFactory which is used if no DocumentFactory is specified when building using the standard builders. |
Namespace |
getNamespace(java.lang.String uri)
|
Namespace |
getNoNamespace()
|
java.util.List |
getQNames()
Returns a list of all the QName instances currently used by this document factory |
Namespace |
getXmlNameSpace()
|
java.util.Map |
getXPathNamespaceURIs()
|
protected void |
init()
|
protected QName |
intern(QName qname)
|
void |
setXPathNamespaceURIs(java.util.Map xpathNamespaceURIs)
Sets the namespace URIs to be used by XPath expressions created by this factory or by nodes associated with this factory. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient QNameCache cache
Constructor Detail |
public DocumentFactory()
Method Detail |
public static DocumentFactory getInstance()
Access to singleton implementation of DocumentFactory which is used if no DocumentFactory is specified when building using the standard builders.
public Document createDocument()
createDocument
in interface NodeFactory
public Document createDocument(Element rootElement)
createDocument
in interface NodeFactory
public DocumentType createDocType(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
createDocType
in interface NodeFactory
public Element createElement(QName qname)
createElement
in interface NodeFactory
public Element createElement(java.lang.String name)
createElement
in interface NodeFactory
public Element createElement(java.lang.String qualifiedName, java.lang.String namespaceURI)
createElement
in interface NodeFactory
public Attribute createAttribute(Element owner, QName qname, java.lang.String value)
createAttribute
in interface NodeFactory
public Attribute createAttribute(Element owner, java.lang.String name, java.lang.String value)
createAttribute
in interface NodeFactory
public CDATA createCDATA(java.lang.String text)
createCDATA
in interface NodeFactory
public Comment createComment(java.lang.String text)
createComment
in interface NodeFactory
public Text createText(java.lang.String text)
createText
in interface NodeFactory
public Entity createEntity(java.lang.String name, java.lang.String text)
createEntity
in interface NodeFactory
public Namespace createNamespace(java.lang.String prefix, java.lang.String uri)
createNamespace
in interface NodeFactory
public Namespace getNamespace(java.lang.String uri)
getNamespace
in interface NodeFactory
public Namespace getXmlNameSpace()
getXmlNameSpace
in interface NodeFactory
public Namespace getNoNamespace()
getNoNamespace
in interface NodeFactory
public ProcessingInstruction createProcessingInstruction(java.lang.String target, java.lang.String data)
createProcessingInstruction
in interface NodeFactory
public ProcessingInstruction createProcessingInstruction(java.lang.String target, java.util.Map data)
createProcessingInstruction
in interface NodeFactory
public QName createQName(java.lang.String localName, Namespace namespace)
createQName
in interface NodeFactory
public QName createQName(java.lang.String localName)
createQName
in interface NodeFactory
public QName createQName(java.lang.String name, java.lang.String prefix, java.lang.String uri)
createQName
in interface NodeFactory
public QName createQName(java.lang.String qualifiedName, java.lang.String uri)
createQName
in interface NodeFactory
public XPath createXPath(java.lang.String xpathExpression) throws InvalidXPathException
createXPath
parses an XPath expression
and creates a new XPath XPath
instance.
createXPath
in interface XPathFactory
xpathExpression
- is the XPath expression to create
XPath
instance
InvalidXPathException
- if the XPath expression is invalidpublic XPath createXPath(java.lang.String xpathExpression, org.jaxen.VariableContext variableContext)
createXPath
parses an XPath expression
and creates a new XPath XPath
instance.
createXPath
in interface XPathFactory
xpathExpression
- is the XPath expression to createvariableContext
- is the variable context to use when evaluating the XPath
XPath
instance
InvalidXPathException
- if the XPath expression is invalidpublic NodeFilter createXPathFilter(java.lang.String xpathFilterExpression, org.jaxen.VariableContext variableContext)
createXPathFilter
parses a NodeFilter
from the given XPath filter expression.
XPath filter expressions occur within XPath expressions such as
self::node()[ filterExpression ]
createXPathFilter
in interface XPathFactory
xpathFilterExpression
- is the XPath filter expression
to createvariableContext
- is the variable context to use when evaluating the XPath
NodeFilter
instancepublic NodeFilter createXPathFilter(java.lang.String xpathFilterExpression)
createXPathFilter
parses a NodeFilter
from the given XPath filter expression.
XPath filter expressions occur within XPath expressions such as
self::node()[ filterExpression ]
createXPathFilter
in interface XPathFactory
xpathFilterExpression
- is the XPath filter expression
to create
NodeFilter
instancepublic Pattern createPattern(java.lang.String xpathPattern)
createPattern
parses the given
XPath expression to create an XSLT style Pattern
instance
which can then be used in an XSLT processing model.
createPattern
in interface XPathFactory
xpathPattern
- is the XPath pattern expression
to create
Pattern
instancepublic java.util.List getQNames()
public java.util.Map getXPathNamespaceURIs()
public void setXPathNamespaceURIs(java.util.Map xpathNamespaceURIs)
setXPathNamespaceURIs
in interface XPathFactory
protected static DocumentFactory createSingleton(java.lang.String className)
createSingleton
creates the singleton instance
from the given class name.
className
- is the name of the DocumentFactory class to use
protected QName intern(QName qname)
protected QNameCache createQNameCache()
protected void init()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |