|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdom2.input.DOMBuilder
public class DOMBuilder
Builds a JDOM Document from a pre-existing DOM org.w3c.dom.Document
.
If you are building a document that has Namespace declarations, you should ensure that the Namespaces are correctly recorded in the DOM document before building the JDOM document from the DOM. By default, the native Java DOMBuilderFactory is configured to ignore Namespaces, and thus they are 'lost' in the DOM tree. JDOM expects Namespace-aware documents, so you should ensure that you change the default settings on the DOMBuilderFactory before parsing the DOM document. For example:
DocumentBuilderFactory domfactory = DocumentBuilderFactory.newInstance(); domfactory.setNamespaceAware(true); DocumentBuilder dombuilder = domfac.newDocumentBuilder(); org.w3c.dom.Document doc = dombuilder.parse(....);
Constructor Summary | |
---|---|
DOMBuilder()
This creates a new DOMBuilder instance using the DefaultJDOMFactory to build the JDOM content. |
Method Summary | |
---|---|
CDATA |
build(org.w3c.dom.CDATASection cdata)
This will build a JDOM CDATA from an existing DOM CDATASection |
Comment |
build(org.w3c.dom.Comment comment)
This will build a JDOM Comment from an existing DOM Comment |
Document |
build(org.w3c.dom.Document domDocument)
This will build a JDOM tree from an existing DOM tree. |
DocType |
build(org.w3c.dom.DocumentType doctype)
This will build a JDOM Element from an existing DOM Element |
Element |
build(org.w3c.dom.Element domElement)
This will build a JDOM Element from an existing DOM Element |
EntityRef |
build(org.w3c.dom.EntityReference er)
This will build a JDOM EntityRef from an existing DOM EntityReference |
ProcessingInstruction |
build(org.w3c.dom.ProcessingInstruction pi)
This will build a JDOM ProcessingInstruction from an existing DOM ProcessingInstruction |
Text |
build(org.w3c.dom.Text text)
This will build a JDOM Text from an existing DOM Text |
JDOMFactory |
getFactory()
Returns the current JDOMFactory in use. |
void |
setFactory(JDOMFactory factory)
This sets a custom JDOMFactory for the builder. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DOMBuilder()
Method Detail |
---|
public void setFactory(JDOMFactory factory)
factory
- JDOMFactory
to usepublic JDOMFactory getFactory()
JDOMFactory
in use.
public Document build(org.w3c.dom.Document domDocument)
domDocument
- org.w3c.dom.Document
object
Document
- JDOM document object.public Element build(org.w3c.dom.Element domElement)
domElement
- org.w3c.dom.Element
object
Element
- JDOM Element objectpublic CDATA build(org.w3c.dom.CDATASection cdata)
cdata
- org.w3c.dom.CDATASection
object
CDATA
- JDOM CDATA objectpublic Text build(org.w3c.dom.Text text)
text
- org.w3c.dom.Text
object
Text
- JDOM Text objectpublic Comment build(org.w3c.dom.Comment comment)
comment
- org.w3c.dom.Comment
object
Comment
- JDOM Comment objectpublic ProcessingInstruction build(org.w3c.dom.ProcessingInstruction pi)
pi
- org.w3c.dom.ProcessingInstruction
object
ProcessingInstruction
- JDOM ProcessingInstruction objectpublic EntityRef build(org.w3c.dom.EntityReference er)
er
- org.w3c.dom.EntityReference
object
EnityRef
- JDOM EntityRef objectpublic DocType build(org.w3c.dom.DocumentType doctype)
doctype
- org.w3c.dom.Element
object
Element
- JDOM Element object
|
JDOM 2.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |