📄 document.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Fri Feb 22 14:38:36 CET 2002 --><TITLE>: Class Document</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../org/kxml/kdom/Element.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Document.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">org.kxml.kdom</FONT><BR>Class Document</H2><PRE>java.lang.Object | +--<A HREF="../../../org/kxml/kdom/Node.html">org.kxml.kdom.Node</A> | +--<B>org.kxml.kdom.Document</B></PRE><DL><DT><B>All Implemented Interfaces:</B> <DD><A HREF="../../../org/kxml/XmlIO.html">XmlIO</A></DD></DL><HR><DL><DT>public class <B>Document</B><DT>extends <A HREF="../../../org/kxml/kdom/Node.html">Node</A></DL><P>The document consists of some legacy events and a single rootelement. This class basically adds some consistency checks toNode.<P><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/kxml/kdom/Document.html#rootIndex">rootIndex</A></B></CODE><BR> </TD></TR></TABLE> <A NAME="fields_inherited_from_class_org.kxml.kdom.Node"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Fields inherited from class org.kxml.kdom.<A HREF="../../../org/kxml/kdom/Node.html">Node</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../org/kxml/kdom/Node.html#children">children</A>, <A HREF="../../../org/kxml/kdom/Node.html#types">types</A></CODE></TD></TR></TABLE> <!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../../../org/kxml/kdom/Document.html#Document()">Document</A></B>()</CODE><BR> </TD></TR></TABLE> <!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/kxml/kdom/Document.html#addChild(int, int, java.lang.Object)">addChild</A></B>(int index, int type, java.lang.Object child)</CODE><BR> Adds a child at the given index position.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> java.lang.String</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/kxml/kdom/Document.html#getName()">getName</A></B>()</CODE><BR> returns "#document"</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../org/kxml/kdom/Element.html">Element</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/kxml/kdom/Document.html#getRootElement()">getRootElement</A></B>()</CODE><BR> returns the root element of this document.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/kxml/kdom/Document.html#parse(org.kxml.parser.AbstractXmlParser)">parse</A></B>(<A HREF="../../../org/kxml/parser/AbstractXmlParser.html">AbstractXmlParser</A> parser)</CODE><BR> reads the document and checks if the last eventis END_DOCUMENT.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../org/kxml/kdom/Document.html#removeChild(int)">removeChild</A></B>(int index)</CODE><BR> Removes the child object at the given index</TD></TR></TABLE> <A NAME="methods_inherited_from_class_org.kxml.kdom.Node"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class org.kxml.kdom.<A HREF="../../../org/kxml/kdom/Node.html">Node</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../org/kxml/kdom/Node.html#addChild(int, java.lang.Object)">addChild</A>, <A HREF="../../../org/kxml/kdom/Node.html#createElement(java.lang.String, java.lang.String)">createElement</A>, <A HREF="../../../org/kxml/kdom/Node.html#getChild(int)">getChild</A>, <A HREF="../../../org/kxml/kdom/Node.html#getChildCount()">getChildCount</A>, <A HREF="../../../org/kxml/kdom/Node.html#getElement(int)">getElement</A>, <A HREF="../../../org/kxml/kdom/Node.html#getElement(java.lang.String)">getElement</A>, <A HREF="../../../org/kxml/kdom/Node.html#getElement(java.lang.String, java.lang.String)">getElement</A>, <A HREF="../../../org/kxml/kdom/Node.html#getNamespace()">getNamespace</A>, <A HREF="../../../org/kxml/kdom/Node.html#getText()">getText</A>, <A HREF="../../../org/kxml/kdom/Node.html#getText(int)">getText</A>, <A HREF="../../../org/kxml/kdom/Node.html#getType(int)">getType</A>, <A HREF="../../../org/kxml/kdom/Node.html#indexOf(java.lang.String, int)">indexOf</A>, <A HREF="../../../org/kxml/kdom/Node.html#indexOf(java.lang.String, java.lang.String, int)">indexOf</A>, <A HREF="../../../org/kxml/kdom/Node.html#toString()">toString</A>, <A HREF="../../../org/kxml/kdom/Node.html#write(org.kxml.io.AbstractXmlWriter)">write</A>, <A HREF="../../../org/kxml/kdom/Node.html#writeChildren(org.kxml.io.AbstractXmlWriter)">writeChildren</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.Object</B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait</CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="rootIndex"><!-- --></A><H3>rootIndex</H3><PRE>protected int <B>rootIndex</B></PRE><DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="Document()"><!-- --></A><H3>Document</H3><PRE>public <B>Document</B>()</PRE><DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="getName()"><!-- --></A><H3>getName</H3><PRE>public java.lang.String <B>getName</B>()</PRE><DL><DD>returns "#document"<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/kxml/kdom/Node.html#getName()">getName</A></CODE> in class <CODE><A HREF="../../../org/kxml/kdom/Node.html">Node</A></CODE></DL></DD></DL><HR><A NAME="addChild(int, int, java.lang.Object)"><!-- --></A><H3>addChild</H3><PRE>public void <B>addChild</B>(int index, int type, java.lang.Object child)</PRE><DL><DD>Adds a child at the given index position. Throwsan exception when a second root element is added<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/kxml/kdom/Node.html#addChild(int, int, java.lang.Object)">addChild</A></CODE> in class <CODE><A HREF="../../../org/kxml/kdom/Node.html">Node</A></CODE></DL></DD></DL><HR><A NAME="parse(org.kxml.parser.AbstractXmlParser)"><!-- --></A><H3>parse</H3><PRE>public void <B>parse</B>(<A HREF="../../../org/kxml/parser/AbstractXmlParser.html">AbstractXmlParser</A> parser) throws java.io.IOException</PRE><DL><DD>reads the document and checks if the last eventis END_DOCUMENT. If not, an exception is thrown.The end event is consumed. For parsing partialXML structures, consider using Node.parse ().<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/kxml/kdom/Node.html#parse(org.kxml.parser.AbstractXmlParser)">parse</A></CODE> in class <CODE><A HREF="../../../org/kxml/kdom/Node.html">Node</A></CODE></DL></DD></DL><HR><A NAME="removeChild(int)"><!-- --></A><H3>removeChild</H3><PRE>public void <B>removeChild</B>(int index)</PRE><DL><DD><B>Description copied from class: <CODE><A HREF="../../../org/kxml/kdom/Node.html">Node</A></CODE></B></DD><DD>Removes the child object at the given index<DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../org/kxml/kdom/Node.html#removeChild(int)">removeChild</A></CODE> in class <CODE><A HREF="../../../org/kxml/kdom/Node.html">Node</A></CODE></DL></DD></DL><HR><A NAME="getRootElement()"><!-- --></A><H3>getRootElement</H3><PRE>public <A HREF="../../../org/kxml/kdom/Element.html">Element</A> <B>getRootElement</B>()</PRE><DL><DD>returns the root element of this document.</DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_bottom"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3"> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS <A HREF="../../../org/kxml/kdom/Element.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A> <A HREF="Document.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: INNER | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -