|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.pdark.decentxml.NodeWithChildren
de.pdark.decentxml.Document
public class Document
This class represents an XML document.
If you add a ProcessingInstruction as the first node of the document,
it will be converted into an XMLDeclaration.
Note: The automatic creation of XMLDeclaration is not perfect; if you
manipulate the list of nodes yourself (for example, via getNodes().add()),
then you're on your own.
| Constructor Summary | |
|---|---|
Document()
|
|
Document(Node... nodes)
|
|
| Method Summary | |
|---|---|
Document |
addNode(int index,
Node node)
|
Document |
addNode(Node node)
|
Document |
addNodes(java.util.Collection<? extends Node> nodes)
|
Document |
addNodes(int index,
java.util.Collection<? extends Node> nodes)
|
Document |
addNodes(int index,
Node... nodes)
|
Document |
addNodes(Node... nodes)
|
protected void |
clearXMLDeclaration()
|
Document |
copy()
Simulate clone() |
Document |
copy(Node orig)
Copy all data from orig into this |
Document |
createClone()
Simulate clone() |
protected XMLDeclaration |
createXMLDeclaration()
|
Element |
getChild(java.lang.String path)
Find a child element (not a node!) by path |
Element |
getChild(java.lang.String path,
Namespace ns)
|
DocType |
getDocType()
|
java.lang.String |
getEncoding()
|
Namespace |
getNamespace(java.lang.String prefix)
|
Namespaces |
getNamespaces()
|
Element |
getRootElement()
|
XMLTokenizer.Type |
getType()
Get the node type |
java.lang.String |
getVersion()
|
XMLDeclaration |
getXmlDeclaration()
|
boolean |
isStandalone()
|
void |
parseXMLDeclaration()
Parse a possible XML declaration and fill the internal fields with the data. |
Node |
removeNode(int index)
Remove a node from the list |
boolean |
removeNode(Node n)
Remove a node from the list |
void |
setDocType(DocType docType)
|
Document |
setEncoding(java.lang.String encoding)
|
void |
setNamespaces(Namespaces namespaces)
|
Document |
setRootNode(Element rootNode)
|
void |
setStandalone(boolean standalone)
|
Document |
setVersion(java.lang.String version)
|
void |
setXmlDeclaration(XMLDeclaration xmlDeclaration)
|
Document |
toXML(XMLWriter writer)
Fast way to convert many nodes to XML |
| Methods inherited from class de.pdark.decentxml.NodeWithChildren |
|---|
clearNodes, getNode, getNodes, getNodes, hasNodes, nodeCount, nodeIndexOf, toString, toXML |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface de.pdark.decentxml.Parent |
|---|
clearNodes, getNode, getNodes, hasNodes, nodeCount, nodeIndexOf |
| Methods inherited from interface de.pdark.decentxml.Node |
|---|
toXML |
| Constructor Detail |
|---|
public Document()
public Document(Node... nodes)
| Method Detail |
|---|
public Document addNode(Node node)
addNode in interface ParentaddNode in class NodeWithChildren
public Document addNode(int index,
Node node)
addNode in interface ParentaddNode in class NodeWithChildrenpublic Document addNodes(java.util.Collection<? extends Node> nodes)
addNodes in interface ParentaddNodes in class NodeWithChildren
public Document addNodes(int index,
java.util.Collection<? extends Node> nodes)
addNodes in interface ParentaddNodes in class NodeWithChildrenpublic Document addNodes(Node... nodes)
addNodes in interface ParentaddNodes in class NodeWithChildren
public Document addNodes(int index,
Node... nodes)
addNodes in interface ParentaddNodes in class NodeWithChildrenpublic Node removeNode(int index)
Parent
removeNode in interface ParentremoveNode in class NodeWithChildrenpublic boolean removeNode(Node n)
Parent
removeNode in interface ParentremoveNode in class NodeWithChildrenpublic Element getChild(java.lang.String path)
Parent
getChild in interface Parent
public Element getChild(java.lang.String path,
Namespace ns)
public XMLTokenizer.Type getType()
Node
getType in interface Nodepublic Element getRootElement()
public Document setRootNode(Element rootNode)
public XMLDeclaration getXmlDeclaration()
public void setXmlDeclaration(XMLDeclaration xmlDeclaration)
public java.lang.String getVersion()
public Document setVersion(java.lang.String version)
protected XMLDeclaration createXMLDeclaration()
public java.lang.String getEncoding()
public Document setEncoding(java.lang.String encoding)
public boolean isStandalone()
public void setStandalone(boolean standalone)
public Document toXML(XMLWriter writer)
throws java.io.IOException
Node
toXML in interface NodetoXML in class NodeWithChildrenjava.io.IOExceptionpublic void parseXMLDeclaration()
protected void clearXMLDeclaration()
public DocType getDocType()
public void setDocType(DocType docType)
public Namespaces getNamespaces()
public void setNamespaces(Namespaces namespaces)
public Namespace getNamespace(java.lang.String prefix)
public Document createClone()
Node
createClone in interface Nodepublic Document copy(Node orig)
Nodeorig into this
copy in interface Nodecopy in class NodeWithChildrenpublic Document copy()
Node
copy in interface Nodecopy in class NodeWithChildren
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||