public class Document extends Node
| Modifier and Type | Field and Description |
|---|---|
protected int |
rootIndex |
CDSECT, children, COMMENT, DOCDECL, DOCUMENT, ELEMENT, ENTITY_REF, IGNORABLE_WHITESPACE, PROCESSING_INSTRUCTION, TEXT, types| Constructor and Description |
|---|
Document() |
| Modifier and Type | Method and Description |
|---|---|
void |
addChild(int index,
int type,
Object child)
Adds a child at the given index position.
|
String |
getEncoding()
returns "#document"
|
String |
getName() |
Element |
getRootElement()
returns the root element of this document.
|
Boolean |
getStandalone() |
void |
parse(XmlPullParser parser)
reads the document and checks if the last event
is END_DOCUMENT.
|
void |
removeChild(int index)
Removes the child object at the given index
|
void |
setEncoding(String enc) |
void |
setStandalone(Boolean standalone) |
void |
write(XmlSerializer writer)
Writes this node to the given XmlWriter.
|
addChild, createElement, getChild, getChildCount, getElement, getElement, getText, getType, indexOf, isText, writeChildrenpublic void addChild(int index,
int type,
Object child)
public String getEncoding()
public String getName()
public Element getRootElement()
public Boolean getStandalone()
public void parse(XmlPullParser parser) throws IOException, XmlPullParserException
parse in class NodeIOExceptionXmlPullParserExceptionpublic void removeChild(int index)
NoderemoveChild in class Nodepublic void setEncoding(String enc)
public void setStandalone(Boolean standalone)
public void write(XmlSerializer writer) throws IOException
write in class NodeIOException